Answered
How to put a constant multiple along y-axis in the plot window?
%Example t=0:0.1:10; y=sin(t); plot(t,y) cst=1000 old_Yticks=get(gca,'ytick') new_Yticklabel=arrayfun(@num2str,old_Yti...

13 years ago | 0

Answered
Representing the result in grayscale
Use <http://www.mathworks.com/help/images/ref/rgb2gray.html rgb2gray> function

13 years ago | 0

Answered
Plotting a set of data with respect to another set of data
Why not |plot(U,C)| ?

13 years ago | 0

Answered
How to consolidate rows with same value, while adding their cells?
s = { '2/1', 4; '2/1', 5; '2/1', 6; '2/2', 2; '2/2', 3; '2/2', 1; '2/2',4} [a,b,c]=unique(s(:,1),'stable') out=[a num2cell(a...

13 years ago | 0

Answered
Generating a Square Wave with Varying Frequency
<</matlabcentral/answers/uploaded_files/4330/ansm2.jpg>> you can also change the width of the pulse by adding another s...

13 years ago | 1

| accepted

Answered
Indexing to create a new array
mNEE =[1.0000 NaN 2.0000 NaN 3.0000 0.2165 4.0000 3.9982 5.0000 18.3253 6.0000 32.60...

13 years ago | 0

Answered
std in matlab cell
Z={[1 2 3],[6 8 12],[3 12 20]} out=cellfun(@std,Z) The result will be a 1x3 array std of [1 2 3] std of [6 8 12] s...

13 years ago | 0

Answered
Summation with a vector
n=-10:10 x=[zeros(1,11) ones(1,10)] stem(n,x)

13 years ago | 1

| accepted

Answered
plotting the histogram of data points
data = [0,2,9,2,5,8,7,3,1,9,4,3,5,8,10,0,1,2,9,5,10]; d=unique(data) y= histc(data,d) bar(d,y) Look at help hist ...

13 years ago | 1

| accepted

Answered
How to iterate in simulink?
% x(i+1)=x(i)+4*(x(i)-y(i)); % can be written as % x(i+1)-5x(i)=-4y(i) % z X(z)-5X(z)=-4Y(z) % H(z)=-4/(z-5) To get the r...

13 years ago | 0

| accepted

Answered
Cell Array and Matrix polynimial
syms s X=[1 2 3 4; 5 6 7 8]; Y=(s-2)*X; D = {[1 2 ] , [1 3] ; [1 6] , [5 2] }; M=Y-cell2mat(D)

13 years ago | 1

| accepted

Answered
Multiplication of a matrix element wise with a polynomial
syms s L=eye(2,4) p=s-3 out=L*p

13 years ago | 0

| accepted

Answered
Cell Array and Matrix
One of the possibilities D = {[1 2],[1 1] ;[1 6 ],[5 2]} L=[1 0 0 0; 0 1 0 0 ]; out=cellfun(@(x) x*L,D,'un',0) %or ma...

13 years ago | 0

| accepted

Answered
Display matrix with row and column labels
Use uitable x=1:10 M=[x;x.^2+1] r={'x' 'x^2+1'} f=figure('position',[100 100 900 200]) t=uitable(f,'data',M,'rowname',r...

13 years ago | 0

| accepted

Answered
delete empty [] {1x7 cell} {1x2 cell}
z(cellfun('isempty',z))=[]

13 years ago | 0

| accepted

Answered
how do i convert a given set of values into a function?
Use <http://www.mathworks.com/help/curvefit/fit.html fit> function, but you will need a <http://www.mathworks.com/products/curve...

13 years ago | 0

Answered
Not enough input arguments?
You can't run a Matlab function, read about functions at this link <http://www.mathworks.com/help/matlab/ref/function.html> ...

13 years ago | 0

Answered
Error using plot Vectors must be the same lengths.
Maybe some previous result are interfering with your code, try this clear t=[0 .3 .5 .75 .95 .99]; for i = 1:length(t) ...

13 years ago | 1

| accepted

Answered
Command Window and code script View
In the right top corner of your editor windows, look for |Dock Editor or Undock Editor|

13 years ago | 3

Answered
Put data into a matrix contained in a cell
Your expression is not correct, you cant write A=B=C Why do you think that [2,2] is a 2x2 matrix? obviously, it's a ...

13 years ago | 1

| accepted

Answered
How to truncate this matrix
unique(a,'rows')

13 years ago | 0

| accepted

Answered
why i can not use imwrite?
Maybe the file |moosh.jpg| exists already and is read only. Try another name.

13 years ago | 0

Answered
How to split a vector based on using another value?
A=[10,9,8,7,6,5,4,3,2,1] ; B=A(A>4) C=A(A<=4)

13 years ago | 2

| accepted

Answered
How to resize elements in GUI?
To get the screen size, use screen_size=get(0,'ScreenSize');

13 years ago | 0

| accepted

Answered
?? Error using ==> plot3 String argument is an unknown option.
To use plot3, you need three vectors x,y and z. You don't need a for loop plot3(MON(:,1),MON(:,2),MON(:,3),'x')

13 years ago | 0

Answered
Difference between two Vectors
A = [-1 1 -2 1 -1 1 -1 -2 -1 1]; B = [-1 1 1 -1 1 -1 -1 1]; a=setdiff(A,B) index=find(ismember(A,a)) values=A(index)

13 years ago | 1

| accepted

Load more