Answered
Create a symbolic function with varying number of elements
syms x N=4; f(x)=sum(x.^(0:N))

7 years ago | 0

| accepted

Answered
How to replace some values in an array with zero and some with values from another array?
C=A; C(A==0)=B; C(A>0)=0

7 years ago | 1

| accepted

Answered
How to use 'setdiff' func. on cells
cellfun(@setdiff,a,b,'un',0)

7 years ago | 1

| accepted

Answered
Where is an error of product operation in SIMULINK?
Leave the matrix as size 1 X 178 don’t transpose.

7 years ago | 1

| accepted

Answered
how to compare non numerical values or character strings element-wise between a table and a one dimensional array ?
https://in.mathworks.com/matlabcentral/answers/450866-how-to-compare-non-numerical-values-or-character-strings-element-wise-betw...

7 years ago | 0

| accepted

Answered
how to store output for different values of i's ?
p=cell(1,4); % before loop p{i}=... % inside loop

7 years ago | 0

| accepted

Answered
eliminate column for condition
Ans(:, any( (Ans <= 60) | ( Ans >= 80 ),1)) = [] % don’t name a variable ans

7 years ago | 0

Answered
Matrix multiplication element wise
A.*B.' % ^-—-—-I can see in your code you swapped indices for B(j,i) doc times

7 years ago | 0

| accepted

Answered
Matlab code required for plotting 3 variables
https://in.mathworks.com/help/matlab/ref/plotyy.html https://in.mathworks.com/help/matlab/ref/yyaxis.html

7 years ago | 0

Answered
How can i use If block for a matrix in SIMULINK?
Ok lets use some vectorised method (logical indexing):

7 years ago | 1

| accepted

Answered
replace with nans after condition
Out = A; Out(A < (max(A)/100)*15)=nan

7 years ago | 0

| accepted

Answered
replace minimum value of each column with nan
M(M==min(M))=nan % where M is your matrix

7 years ago | 0

| accepted

Answered
Export a table in matlab to PDF
https://in.mathworks.com/matlabcentral/answers/406897-how-to-save-uitable-uifigure-into-pdf-file#answer_325806

7 years ago | 0

Answered
Rearranging Array Rows into Multiple Blocks while Maintaining the Old Order
reshape(matrix,[],size(matrix,2))

7 years ago | 1

Answered
replace values with nans
data(idx)=NaN

7 years ago | 0

| accepted

Answered
Combine Array from different cell
{cat(1,yourcell{:})} %or {vertcat(yourcell{:})}

7 years ago | 0

Answered
How to get a string array without any space when using NUM2STR function ???
S = ""+(0:31).'

7 years ago | 1

| accepted

Answered
retrieve binary data back
c=strjoin(regexp(c,'\d{2}+','match')); % for safety measure % ^----- your original binary data Actual_datas={'0...

7 years ago | 3

Answered
change two variable in the name in a loop using eval or any other command
I suggest you to use struct with dynamic field names ( https://blogs.mathworks.com/loren/2005/12/13/use-dynamic-field-references...

7 years ago | 0

| accepted

Answered
Fsolve Error! Need help- Using Fsolve to solve system of non-linear equations.
Make the below changes in your code: [x,fval]= fsolve(@(x)myfun(x,cpa,cpg,Qin,t2,t1,p1,p2,px,p3,p5,nreg,nc,nt),x0,options); fu...

7 years ago | 0

| accepted

Answered
How can I find the minimum value from all the cells in a cell array?
[Value,Which_cell]=min(cellfun(@sum,C)) % or [Value,Which_cell]=min(sum(cat(1,C{:}),2)) % assuming all cells have same size of...

7 years ago | 0

| accepted

Answered
Random Number from -1 to 1
Numbers = (1-(-1)).*rand(100,1)+(-1) % ^^^^^---- number of points

7 years ago | 1

| accepted

Answered
How to plot over another surface?
hold on % after first surf() command

7 years ago | 0

Answered
How to reshape cell of characters to a different cell size of characters?
https://in.mathworks.com/matlabcentral/answers/450489-how-to-reshape-cell-of-characters-to-a-different-cell-size-of-characters#c...

7 years ago | 1

| accepted

Answered
how to reshape cell to matrix?
cat(1,yourcell{:})

7 years ago | 1

| accepted

Answered
Plotting certain values of a matrix
plot(repmat(100,100,1),x) % ^^^-—-—-n hold on plot(repmat(2,100,1),x)

7 years ago | 0

| accepted

Answered
How to convert 1x21 array to table
array2table(lambda) % this creates 1 X 21 table % .' to transpose to form 21 X 1 table %or table(lambda) To name a table the...

7 years ago | 0

Answered
dlmread shows incorrect data after using disp
format longg % at the beginning of the script

7 years ago | 1

| accepted

Answered
Replacing elements in a table
A=table2array(A); A(isinf(A)|-isinf(A))=nan; A=array2table(A)

7 years ago | 0

| accepted

Load more