Answered
how to find the number of occurances
x=[1 1 1 1 2 2 1 1 3 3]; idx=logical([diff(x)~=0,1]); x1=x(idx) yy=find(idx); yyy=diff(find(idx)); y1=[yy(1) yyy] x2=histc...

7 years ago | 1

| accepted

Answered
How to create an structure fields from an cell array?
Use readtable() requires 2016b or later to read the excel file and then give table the variable names and then simply use table2...

7 years ago | 0

Answered
How do I ascribe a variable to a cell?
The proper way to access it would be( see Accessing cell array for better understanding): x = soilstructure{:,7} % but I don’t...

7 years ago | 1

| accepted

Answered
I see no lines on my graph after I plot them
k is not defined , it’s better you plot after the loop by saving the values in each iteration by using loop iterator as an index...

7 years ago | 0

Answered
Minimum point of Graph
syms x y=x^2 x=solve(diff(y)==0)

7 years ago | 0

Answered
plotting projectile with drag
https://in.mathworks.com/matlabcentral/answers/372413-projectile-motion-with-drag#answer_295804

7 years ago | 0

Answered
What format should my Z values be when making a contour plot?
contourf(LAT,D,repmat(T,1,numel(D)),20); % or repmat(T,1,numel(D))' if that doesn't work

7 years ago | 1

| accepted

Answered
Print for loop iterations with their specific label
Don't think of naming variables dynamically but if it's for your label then sprintf()(lookup in the documentation) should do it....

7 years ago | 0

Answered
STL file from 3D array
https://in.mathworks.com/matlabcentral/answers/45020-matlab-to-cad-program#answer_57443

7 years ago | 0

Answered
How to store vectores which have different lengts? (in a loop)
Store it as cell like below: ar=cell(1,4); for i=2:5 ar{i-1}=ones(1,q(i)-q(i-1)+2); end celldisp(ar)

7 years ago | 1

| accepted

Answered
Finding column 2 values for column 1 value in a multidimensional array
A = [0.22 0.11; 0.33 0.11; 0.55 0.66]; B = 0.12; idx=ismembertol(A,B,0.1); x=A(any(idx,2),1) y=A(any(idx,2),2) Gives: x = ...

7 years ago | 0

| accepted

Answered
Correlate a 3d array into n times 2d rows
Don't even think of creating numbered variables use cell instead matrix=yourmatrix'; n=size(matrix,1); result=cell(1,n); for...

7 years ago | 0

Answered
How to save file as pdf?
saveas(gcf,'objective.pdf') % without objectiveoutput =

7 years ago | 0

| accepted

Answered
Putting column vector in a matrix
gradv=cell(1,N); for i = 1:N for row = 1 : n for col = 1:m grad(row,col)= .... %%%% I get a n x m mat...

7 years ago | 1

| accepted

Answered
update to matlab version 2018a
You can check everything in the given link :https://www.mathworks.com/help/matlab/release-notes.html

7 years ago | 0

Answered
Is there any way to plot two plots in same figure and changing the transparency separately?
why not? create a handle for each plot command and set the transparency factor as mentioned Here

7 years ago | 0

Answered
How do I get a legend with custom colours in a loop plot?
similiar to figure names define the colours in a cell array and access them in the plot command with loop iterators as the index...

7 years ago | 0

Answered
How can I label my graphs as (a), (b), (c) etc in subplot matlab?
Use legend() legend('(a)','(b)','(c)')

7 years ago | 0

Answered
Regarding the elimination of zero complex terms from State Transition Matrix
The imaginary part is not zero: "Ideally, the eigenvalue decomposition satisfies the relationship. Since eig performs the deco...

7 years ago | 0

Answered
How to zoom at a certain location in a subsystem using script?
https://in.mathworks.com/matlabcentral/answers/76696-how-to-zoom-in-out-on-an-axis-programmatically#answer_86346

7 years ago | 0

Answered
Expression or statement is incorrect--possibly unbalanced (, {, or [.
remove ~ ,~ ,~ ,~ ,~ ,

7 years ago | 0

Answered
HOW SHOULD DRAW THIS IN LOOP FORM? WHERE IS THE PROBLEM IN MY CODE?
x=linspace(-5,5,10000); s=0; for n=1:0.01:10 s=s+(-1^n+1*sin(n*pi*x)); end f=(2/pi)*s; plot(x,f)

7 years ago | 0

Answered
Undefined function or variable 'multisvm'.
https://in.mathworks.com/matlabcentral/fileexchange/39352-multi-class-svm?focused=3776247&tab=function https://in.mathworks.co...

7 years ago | 1

Answered
How to add 1 zero element to the 1st element of my vector?
>> A=[1,2,3]; n=0; A=[n A] A = 0 1 2 3 >>

7 years ago | 1

| accepted

Answered
Assign values to a new variable via a function
sprintf()

7 years ago | 0

Answered
looking for value of existense differential equation
Where there is an aymptote(discontinuity) , the solutions cannot be guaranteed

7 years ago | 1

| accepted

Answered
How to have Matlab publish commands executed in the editor window?
See https://in.mathworks.com/matlabcentral/answers/418108-how-to-publish-matlab-outout-and-code-in-pdf#answer_335949 publish('...

7 years ago | 0

Answered
how to set a specific value for x axis in 3d plot?
Use logical indexing to grasp the values of particular index as shown below :(post your code if it's not what you are looking fo...

7 years ago | 0

Load more