Answered

Array indices must be positive integers or logical values.

(n.*K.*T(K).*ns)) is that supposed to be T*K or T(k)?

Array indices must be positive integers or logical values.

(n.*K.*T(K).*ns)) is that supposed to be T*K or T(k)?

4 jours ago | 0

Answered

Not Generating Accurate Elements from Inequality

Feyqlimit = Fezq(abs(Fezq) <= .025)

Not Generating Accurate Elements from Inequality

Feyqlimit = Fezq(abs(Fezq) <= .025)

4 jours ago | 0

| accepted

Answered

I want to install 2020 matlab win32

https://www.mathworks.com/help/install/?s_cid=doc_ftr

I want to install 2020 matlab win32

https://www.mathworks.com/help/install/?s_cid=doc_ftr

4 jours ago | 0

Answered

Delete part of the third dimension for arrays that store in the cell

to access the data in cells (rather than the cells themselves) and to store data in a new cell array, use {} for i= 1:numel(tma...

Delete part of the third dimension for arrays that store in the cell

to access the data in cells (rather than the cells themselves) and to store data in a new cell array, use {} for i= 1:numel(tma...

4 jours ago | 1

| accepted

Answered

How do I plot a series of points as a collection of 1x2 arrays?

If you have a cell array of 1x2 arrays like so: points = {[1,2] , [2,6] , [8,3] , [6,9]}; then you can turn it into a 1x (2N) ...

How do I plot a series of points as a collection of 1x2 arrays?

If you have a cell array of 1x2 arrays like so: points = {[1,2] , [2,6] , [8,3] , [6,9]}; then you can turn it into a 1x (2N) ...

5 jours ago | 0

Answered

How to sum my matrix element?

from sum documentation: "S = sum(A,'all') computes the sum of all elements of A. This syntax is valid for MATLAB® versions R201...

How to sum my matrix element?

from sum documentation: "S = sum(A,'all') computes the sum of all elements of A. This syntax is valid for MATLAB® versions R201...

5 jours ago | 1

Answered

How to reorder cell array based on the vector

index = [1; 2; 4; 3; 7; 6; 5]; list = {[1158;1159], [1543;1544], [2020;2096;2173], [2159], [4836], [5374], [5492;5493]}; list_...

How to reorder cell array based on the vector

index = [1; 2; 4; 3; 7; 6; 5]; list = {[1158;1159], [1543;1544], [2020;2096;2173], [2159], [4836], [5374], [5492;5493]}; list_...

5 jours ago | 0

| accepted

Answered

group in a small vector

Ok, here is a way: A=[1,0,0,1,1,1]; % turn A into a 1x6 string array tmp=string(A); % reshape into a 3xN string array, then ...

group in a small vector

Ok, here is a way: A=[1,0,0,1,1,1]; % turn A into a 1x6 string array tmp=string(A); % reshape into a 3xN string array, then ...

5 jours ago | 0

| accepted

Answered

How to do permutations with conditions

Actually, this should work V= (1:0.5:5); Comb = combvec(V(2:end),V)'; % if you want sorted by first column: Comb = sortrows(...

How to do permutations with conditions

Actually, this should work V= (1:0.5:5); Comb = combvec(V(2:end),V)'; % if you want sorted by first column: Comb = sortrows(...

5 jours ago | 0

| accepted

Answered

How can I insert data from different table that match a certain value?

% find the index of the offset.FrameNumber row matching each Secc.Seccion element [~,idx] = ismember(Secc.Seccion,offset.FrameN...

How can I insert data from different table that match a certain value?

% find the index of the offset.FrameNumber row matching each Secc.Seccion element [~,idx] = ismember(Secc.Seccion,offset.FrameN...

6 jours ago | 0

| accepted

Answered

How to show the negative value on the graph?

If you want to plot both positive and negative data on a log scale, your best bet is to check out symlog: https://www.mathworks....

How to show the negative value on the graph?

If you want to plot both positive and negative data on a log scale, your best bet is to check out symlog: https://www.mathworks....

13 jours ago | 0

Answered

Plot change in heat for a x y position as a function of time

Look at your Temp variable: Temp=zeros(x_nodes+1,y_nodes+1,t_nodes+1); if you want to know the temperature for a specific loca...

Plot change in heat for a x y position as a function of time

Look at your Temp variable: Temp=zeros(x_nodes+1,y_nodes+1,t_nodes+1); if you want to know the temperature for a specific loca...

13 jours ago | 0

Answered

How to use for loop with xlsread to read multiple sheets in an excel file

from the documentation: num = xlsread(filename,sheet,xlRange) %reads from the specified worksheet and range. so, just loop ove...

How to use for loop with xlsread to read multiple sheets in an excel file

from the documentation: num = xlsread(filename,sheet,xlRange) %reads from the specified worksheet and range. so, just loop ove...

22 jours ago | 0

Answered

Combining if and for loop to iterate through a cell array

to access the contents of a cell array, use {} instead of (): for trialnumber = 1 : length(cellfilename) if cellfilename{t...

Combining if and for loop to iterate through a cell array

to access the contents of a cell array, use {} instead of (): for trialnumber = 1 : length(cellfilename) if cellfilename{t...

22 jours ago | 0

| accepted

Answered

Iterating through 2 Arrays and Performing a Calculation

loop version: for ind=1:length(A2) idx = find(A1 < A2(ind),1,'last'); A3(ind) = A2(ind) - A1(idx); end Another (p...

Iterating through 2 Arrays and Performing a Calculation

loop version: for ind=1:length(A2) idx = find(A1 < A2(ind),1,'last'); A3(ind) = A2(ind) - A1(idx); end Another (p...

22 jours ago | 0

Answered

Calculations using for loops

Two problems: parentheses are not multiplication in matlab, you need * you are trying to insert a variable into itself Soluti...

Calculations using for loops

Two problems: parentheses are not multiplication in matlab, you need * you are trying to insert a variable into itself Soluti...

22 jours ago | 2

| accepted

Answered

save variables to table in for loop

Assuming you just want the final result and don't care about when it prints the filenames: fileID = fopen('filenametable.txt','...

save variables to table in for loop

Assuming you just want the final result and don't care about when it prints the filenames: fileID = fopen('filenametable.txt','...

22 jours ago | 0

Answered

how to move label from axis to the center

First, those are called the xtick labels. It turns out moving them is a pain, but I did find a potential solution here: a=gca; ...

how to move label from axis to the center

First, those are called the xtick labels. It turns out moving them is a pain, but I did find a potential solution here: a=gca; ...

22 jours ago | 0

Answered

Main .m file contains sub .m files and if one crashes, I want it to move to the next .m and carry on.

try a catch warning('Problem using script ''a'''); end try b catch warning('Problem using script ''b''')...

Main .m file contains sub .m files and if one crashes, I want it to move to the next .m and carry on.

try a catch warning('Problem using script ''a'''); end try b catch warning('Problem using script ''b''')...

22 jours ago | 0

| accepted

Answered

Cannot express limits in arrays

If the area is fixed, you don't want independent Y and Z: A = 4345; Z = [33:0.000001:sqrt(A)]; Y = A./Z; Note that the condi...

Cannot express limits in arrays

If the area is fixed, you don't want independent Y and Z: A = 4345; Z = [33:0.000001:sqrt(A)]; Y = A./Z; Note that the condi...

23 jours ago | 0

| accepted

Answered

Could anyone help me how to make the values to be repeated again after 800 iterations for a total of 1000 iterations.

If I understand you correctly, you have data in, let's say, x. You want to set elements 801-1000 of x equal to element 800: x(8...

Could anyone help me how to make the values to be repeated again after 800 iterations for a total of 1000 iterations.

If I understand you correctly, you have data in, let's say, x. You want to set elements 801-1000 of x equal to element 800: x(8...

environ un mois ago | 0

Answered

Colormap for multline plot

I believe this should work: mylines = plot(t, x); set(mylines,{'Color'},flag(length(mylines))) For 2019b+, colororder is ...

Colormap for multline plot

I believe this should work: mylines = plot(t, x); set(mylines,{'Color'},flag(length(mylines))) For 2019b+, colororder is ...

environ un mois ago | 0

Answered

how to find duration of peak; starting and ending points

widths are an optional output from findpeaks: [pks,locs,widths,~] = findpeaks(data);

how to find duration of peak; starting and ending points

widths are an optional output from findpeaks: [pks,locs,widths,~] = findpeaks(data);

environ un mois ago | 0

Answered

How to convert .mat file to png format?

This is not generally possible. mat files store variables, not images. This is like asking "how do I convert a flashdrive into a...

How to convert .mat file to png format?

This is not generally possible. mat files store variables, not images. This is like asking "how do I convert a flashdrive into a...

environ un mois ago | 0

Answered

Save variables in a folder

Check the save documentation, you can save specific variables by adding their names as further inputs: save(resultFileName,'Err...

Save variables in a folder

Check the save documentation, you can save specific variables by adding their names as further inputs: save(resultFileName,'Err...

environ un mois ago | 0

| accepted

Answered

Why it gives Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters

This would be much easier to solve if you included the full error text. But, I suspect the problem is here: function H = hpfil...

Why it gives Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters

This would be much easier to solve if you included the full error text. But, I suspect the problem is here: function H = hpfil...

environ un mois ago | 0

| accepted

Answered

Delete and merge rows and columns based on values of other matrix

If I understand correctly: You have one NxN matrix A And a second 1xN vector B When an element of B is zero, you delete rows ...

Delete and merge rows and columns based on values of other matrix

If I understand correctly: You have one NxN matrix A And a second 1xN vector B When an element of B is zero, you delete rows ...

environ un mois ago | 0

| accepted

Answered

Could anyone please help me to do matrix multiplication with respect to the sample data given below.

Matrix multiplication only works when the "middle" dimension matches ( N x M ) * ( M x O ) Check the sizes of your matrices: >...

Could anyone please help me to do matrix multiplication with respect to the sample data given below.

Matrix multiplication only works when the "middle" dimension matches ( N x M ) * ( M x O ) Check the sizes of your matrices: >...

environ un mois ago | 0

Answered

Could anyone help me how to multiply the second and third element of the row in a matrix by an value of 2 and 3.

A=[ 2 3 4]; A(2) = A(2)*2; A(3) = A(3)*3; More generally, you can use elementwise multiplication: A=[ 2 3 4 5 6 7 8];...

Could anyone help me how to multiply the second and third element of the row in a matrix by an value of 2 and 3.

A=[ 2 3 4]; A(2) = A(2)*2; A(3) = A(3)*3; More generally, you can use elementwise multiplication: A=[ 2 3 4 5 6 7 8];...

environ un mois ago | 0

Answered

How can I create array of numbers +5 the previous number?

start_num = 1; end_num = 15; x=[start_num:5:end_num]; % note that 15 is not included since 1+5+5+5=16 If you actually want t...

How can I create array of numbers +5 the previous number?

start_num = 1; end_num = 15; x=[start_num:5:end_num]; % note that 15 is not included since 1+5+5+5=16 If you actually want t...

environ un mois ago | 0