Answered
Plot multiple data in one plot using for loop
If you look the data in each cell closely infact they are all the same so all the plots overlap each other: plot(x,[y{:}]) % yo...

7 years ago | 0

| accepted

Answered
write statement without using for loop
gi=Alpha.*(bi==0)+Beta.*(bi==1)

7 years ago | 1

| accepted

Answered
For loop averaging increments
Since it’s homework take mean along the first dimension: doc mean

7 years ago | 0

Answered
How can I subs 2 symbolic vectors in 1 comand?
Edit: Corrected the mistake. A workaround: Z=matlabFunction([X,Y]); % change this line XY=num2cell([X0,Y0]); Z(XY{:}) % eval...

7 years ago | 0

Answered
How can I type inverse sign in axis labels? like 1/CL
xlabel('$\frac{1}{CL}$','Interpreter','latex')

7 years ago | 0

Answered
How can I get outcome at a particular value after performing differentiation?
Another option: dx(x)=diff(f); dx(3)

7 years ago | 1

Answered
change appearance of formula
vpa(Total)

7 years ago | 0

| accepted

Answered
How to Show 1/4 in 1/2^2?
I can only think of printing it using fprintf(): fprintf('1/%d^2 ',x)

7 years ago | 1

Answered
Find the row number of element that meets the condition
index=find(A>500,1,'first') B(index)

7 years ago | 1

| accepted

Answered
read csv file in sequence and post process data
Use cell arrays instead of numbering variables ( https://www.mathworks.com/matlabcentral/answers/105936-how-to-make-dynamic-vari...

7 years ago | 1

| accepted

Answered
How to find rearrange these values in a new row and column?
newmatrix = matrix([2 4 5 8],:)

7 years ago | 0

Answered
Why does my index exceed array bounds for the following for loop?
You don’t need a loop mewp* % ^-—-—-missed it

7 years ago | 0

Answered
negative number in vector
c=v(1:find(v<0,1,'first')-1)

7 years ago | 1

| accepted

Answered
How to read only 1 value in row 2, column 1 ?
M = dlmread('csvlist.dat',',',[0,1,0,1])

7 years ago | 0

Answered
How to find first non repeated (unique) character in a string?
u=unique(s,'stable'); % where s is your input Z=arrayfun(@(x)nnz(s==u(x)),1:numel(u)); Result=u(find(Z==1,1,'first'))

7 years ago | 1

| accepted

Answered
Merge two matrices taking non-Null values
C=zeros(size(A)); C(:,~all(isnan(A)))=A(:,~all(isnan(A))); C(:,~all(isnan(B)))=B(:,~all(isnan(B)));

7 years ago | 0

| accepted

Answered
How to remove numbers between specific symbols in text array?
a="Gas_1_O2"; regexprep(a,'\_\d*.?\d*\_','_')

7 years ago | 0

| accepted

Answered
Problem in running my code
Don't name variable max because there is an inbuilt function named max(), preallocate Rhn for speed and efficiency: TN=4; n_ve...

7 years ago | 0

Answered
dsolve problem not showing result
syms y(x) eqn = diff(y) == y/x; vars = y(x); V = odeToVectorField(eqn) M = matlabFunction(V,'vars', {'x','Y'}) interval = [...

7 years ago | 1

| accepted

Answered
I am getting an error like function definitions are not permitted in this context in matlab R2014b
P.s - I am not going to look into your code. I am just answering your main question. https://www.mathworks.com/help/matlab/ref/...

7 years ago | 0

Answered
Can't get fprintf to display my equations answer
%.2f ^-—-—missed it

7 years ago | 0

| accepted

Answered
Problem when importing a TXT file into MATLAB with "readtable". Text and numbers are between single quotes...
T=table2cell(data); T(:,3:end)=cellfun(@str2double,T(:,3:end),'un',0)

7 years ago | 0

| accepted

Answered
indexing multiple values in two arrays with different size
A=sum(a(:,1)==b(:,1).'); a(:,2)=repelem(b(:,2),A).'

7 years ago | 0

| accepted

Answered
Combining arrays of different row length
ABC={A,B,C}; MAX=max(cellfun(@numel,ABC)); D=cell2mat(cellfun(@(x)[x;nan(MAX-numel(x),1)],ABC,'un',0))

7 years ago | 0

Answered
Find the the inices of columns of nonzero entries from rows of a matrix
O=arrayfun(@(x)find(k(x,:)),1:size(k,1),'un',0); celldisp(O)

7 years ago | 0

| accepted

Answered
i want to delete a specific number of NaN in a matrix
A(:,all(isnan(A)))=[]; % delete columns with only NaNs A(:,sum(~isnan(A))==1)=[] % deletes column filled with one number

7 years ago | 0

| accepted

Answered
Computing the rows of the matrix
Interpreting ratio as division: a(3,:)=a(1,:)./a(2,:) % where a is your matrix

7 years ago | 1

| accepted

Answered
Numerically integrating a symbolic expression
syms x y f = matlabFunction(sin(x) - cos(y)); % read about matlabFunction() q = integral2(f, -1, 1, -1, 1) which integral2 ...

7 years ago | 2

| accepted

Answered
How to extract a group of columns from a matrix using loop?
If you prefer a cell array then: RR = arrayfun(@(x) R(:,:,x),1:size(R,3),'un',0); % continuation of other answer celldisp(RR)

7 years ago | 0

Load more