Risposto
How to plot three different colored groups of log plots (5 lines, 5 lines, 2 lines) on the same axes?
You should provied the same number of legends. Something like, legend ('show','0-3m (1)','0-3m (2)','0-3m (3)','0-3m (4)','...

quasi 9 anni fa | 0

Risposto
i want to code such that the loop is constraint for two different values?
N = 108300; x = rand(N,1); sum_rows = 300; l1 = x(1:sum_rows:N); %take every 300th value l1_r = reshape(repmat(l1...

quasi 9 anni fa | 0

| accettato

Risolto


Remove NaN ?
input -> matrix (n*m) with at least one element equal to NaN; output -> matrix(p*m), the same matrix where we deleted the enti...

quasi 9 anni fa

Risolto


Back to basics 21 - Matrix replicating
Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, generate an output matrix that consists o...

quasi 9 anni fa

Risolto


Reverse the elements of an array
Reverse the order of elements in an array: eg: input X = [ 1 2 3 ; 4 5 6 ; 7 8 9 ] o...

quasi 9 anni fa

Risposto
How can I end a for loop when a specific value is reached and create a new array with data that meets that condition?
If I understand correctly, you want to compare |meanr2| with the mean calculated from |ruber| but you're actually comparing it w...

quasi 9 anni fa | 0

Risposto
How to use two different color schemes in one bar chart?
figure wi=1; ax1 = subplot(2,1,1); bar(Y, wi); colormap(ax1,cool) legend('One','Two', 'Three'); ax2 = s...

quasi 9 anni fa | 0

| accettato

Risposto
How to make a break on the x axis?
plot(rand(150,1)) xticks([0 100 120 150])

quasi 9 anni fa | 0

Risposto
format the x-axis in a boxplot
set(gca,'FontAngle', 'italic') %for italics set(gca,'XTickLabel',{'$$a3_{1}$$','$$a3_{2}$$'}); %for...

quasi 9 anni fa | 0

Risposto
How do I run a matlab script automatically from an excel input?
There's nothing you can do inside Matlab to do this. Anyway, you should do it with a batch file and hyperlink that file on your ...

quasi 9 anni fa | 0

Risposto
When I am plotting figure in matlab with many legend entries, the legend box is covering my plot area and making some plots invisible.I tried using 'Orientation','Horizontal',but it spreads out to a larger row.Can anyone help me to resolve issue?
legend('Location','northoutside','Orientation','horizontal') I guess you might also want to fold it into two lines as shown...

quasi 9 anni fa | 0

| accettato

Risposto
How can find a same values in another matrix and copy the row
ind = arrayfun(@(y) find(B(:,1)==y),A(:,1)) CC = [A B(ind,:)]

quasi 9 anni fa | 1

| accettato

Risposto
How to look for minimum value in a vector from backwards?
find(A==A_min,1,'last')

quasi 9 anni fa | 0

Risposto
How can I insert an image when publishing a document?
% <<yourFile.jpg>> Make sure to save your image in the folder where your m-file is being published. More <https://de.mathwo...

quasi 9 anni fa | 0

Risposto
How to get variables needed for Simulink model?
filename = 'yourMatfile.mat'; yourVariables = {'X','caption'}; S = load(filename,yourVariables{:})

quasi 9 anni fa | 0

Risposto
how to update filename in a call to an external application ?
Hi Hans Jørgen Jensen , I've tried your code and yeah, I see your problem. I don't understand it but probably you could simpl...

quasi 9 anni fa | 0

| accettato

Risposto
How Can I add a data to a Stateflow as an input data?
check this <https://de.mathworks.com/help/simulink/slref/fromworkspace.html>

quasi 9 anni fa | 0

Risposto
Average timestamp 20 seconds interval data into hourly
dt = datetime('01.01.2015 00:00:00'):seconds(20):datetime('01.01.2015 05:00:00'); val = rand(901,1); TT = timetable(dt',...

quasi 9 anni fa | 0

Risposto
How do i Filter out table columns headers based on given query words?
x = rand(3,3); rowX = {'A1','A2','A3'}; xT = array2table(x,'RowNames',rowX) xA1 = table2cell(xT({'A1'},:))

quasi 9 anni fa | 0

Risposto
How do calculate the summation of every row in the given table?
yourTable.Sum = sum(yourTable{:,2:end},2);

quasi 9 anni fa | 4

| accettato

Risposto
how to naming files sequently?
prefix = 'TOTL_REDC_2017_07_'; days = {'02_','03_'}; hours = {'0500','0600'}; fileNames = cellfun(@(d,h) [prefix d h]...

quasi 9 anni fa | 0

Risposto
30-day running mean from hourly data
dt = datetime([Yrly_slr(:,1:4) zeros(length(Yrly_slr),2)]); TT = timetable(dt,Yrly_slr(:,5)); TT2 = retime(TT,'monthly',...

quasi 9 anni fa | 1

| accettato

Risposto
while condition to test numeric
t = 1; while t powerInput = input('Please enter the power input, number only and between 35kW and 45kW: '); i...

quasi 9 anni fa | 0

Risposto
Extracting elements from a matrix based on the maximum position in another matrix
arrayfun(@(j,f) A(j,f), J,1:size(A,2))

quasi 9 anni fa | 0

| accettato

Risposto
How small a number has to be to be "equal" to zero?
realmin

circa 9 anni fa | 0

Risposto
how to open datafiles with an exe-file
!your_program.exe your_file

circa 9 anni fa | 0

| accettato

Risolto


Select every other element of a vector
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...

circa 9 anni fa

Risposto
Stacking plots using subplot
figure subplot(3,1,1) %subplot(rows,coloumns,current_axis) subplot(3,1,2) subplot(3,1,3)

circa 9 anni fa | 0

| accettato

Risolto


Swap the first and last columns
Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becomes the first. All oth...

circa 9 anni fa

Carica altro