Answered
problem in using plot function
Type numel(th) % result is 17 numel(t) % result is 18 the two vectors must have the same number of elements Try...

13 years ago | 0

Answered
How to use the inpolygon function ??
X1=[0,0], X2=[2,0], X3=[2,2],X4=[0,2] X=[X1(1),X2(1),X3(1),X4(1)] Y=[X1(2),X2(2),X3(2),X4(2)] inpolygon(1,1,X,Y) % returns ...

13 years ago | 2

| accepted

Answered
maintain constant the values of a controller's output for longer periods of time in simulink
You can use a <http://www.mathworks.com/help/simulink/slref/zeroorderhold.html zoh> block

13 years ago | 0

Answered
creating loop for subtracting values from matrix which size is variable.
out1=a(1:2:end) out2=a(2:2:end)

13 years ago | 0

| accepted

Answered
how to create the .mat file
save data a b %a and b are your arrays, will be saved in the file data.mat

13 years ago | 0

Answered
Can i connect Simulink blocks with a structure within the workspace?
Look at <http://www.mathworks.com/help/simulink/ug/importing-data-structures-to-a-root-level-input-port.html>

13 years ago | 0

Answered
How to plot the .mat file
You can not plot a mat file, what you can do is: load the variables saved in your mat file, then do whatever you want with those...

13 years ago | 0

Answered
how can I make d^(5.13) ??
Use <http://www.mathworks.com/help/simulink/slref/set_param.html set_param> function d=10 set_param('YourModel/Constant'...

13 years ago | 0

| accepted

Answered
Saving images to different files using imwrite()
for k=1:10 filename=sprintf('file%d',k) imwrtie(filename,IM) end

13 years ago | 0

Answered
How to add elements to specific rows in existing array without using for-loop?
D=num2cell(D); A_D=num2cell(A_D); N_D=arrayfun(@(x) A_D(cell2mat(A_D)==x,2),(1:size(D,1))','un',0)

13 years ago | 0

Answered
How to make points larger on plot
plot(x,y,'linewidth',8) %or h=plot(x,y) set(h,'linewidth',4)

13 years ago | 3

| accepted

Answered
Find row that has a cell containing all ones
[rows,col]=find(cellfun(@all ,logic))

13 years ago | 0

| accepted

Answered
How can i increase MATLAB memory?
<http://www.mathworks.com/matlabcentral/answers/2433>

13 years ago | 0

| accepted

Answered
How to know the quatity of the number in an array
out=sum(A(A==1))

13 years ago | 0

| accepted

Answered
How do I remove duplicates from a structure array?
a= {animals.name} b= {animals.class} c=cellfun(@(x,y) [x y],a', b','un',0) [ii,ii]=unique(c,'stable') animals=animals(ii)

13 years ago | 0

| accepted

Answered
How to avoid NaN while evaluating a function
function y=dg(x) y=exp(-x)./(1+exp(-x)).^2 y(isnan(y))=0

13 years ago | 0

Answered
why report error ’ nu = constants ( ) ‘ in Matlab R2012b
Maybe you should assign a value to nu nu=10 % for example

13 years ago | 0

Answered
Equal elements between every two successive vectors equal elements between every two successive vectors in a cell array
str={[1 2 3 4],[2 3 5 6],[5 10 20],[25 40]} n=numel(str); out=cell(n-1,1); for k=1:n-1 out{k}=intersect(str{k},str{k+1}...

13 years ago | 0

| accepted

Answered
Reaching a specific data in txt file
y=Data.data; y(1,1)

13 years ago | 0

| accepted

Answered
Matrix output from function without showing sata of the matrix in the command Window
If your matrix is A assignin('base','A',A);

13 years ago | 0

| accepted

Answered
Polar plot some values
data=[0 0.933 15 0.9417 30 0.9993 45 1 60 1 75 1.2357 90 1.16 105 0.7455 120 0.4155 135 0.2735 150 0.2857 165 1.133...

13 years ago | 0

Answered
Mean of 2 arrays
cellfun(@(x) mean(x(:)),imag)

13 years ago | 0

Answered
Extract non-zero elements from matrix with double precision numbers
out=M(M~=0)

13 years ago | 0

| accepted

Answered
Different arrayname for every data
for a=1:2 [image, head, descrip, iaopt]=loadsir(files{1,a}) imag{a}=image end

13 years ago | 0

| accepted

Answered
How do you get a stand alone matlab application to read images?
You should specify the location of your images in the function imread

13 years ago | 0

Answered
tic toc command in MATLAB GUI
t=toc Then display t in an edit text

13 years ago | 0

Answered
Load many files in matlab
yourfolder='E:\answer\*.sir'; repertoir=dir(yourfolder); files={repertoir.name}

13 years ago | 0

| accepted

Answered
Set indexes not in list to zero.
d(setdiff(1:numel(d),k))=0

13 years ago | 1

Answered
Where to find a book or file that explains the math behind the functions in MATLAB?
In windows command,type doc wblfit

13 years ago | 0

Answered
can I the gain value divide with other gain value??
You can program both sliders to calculate g1/g2

13 years ago | 0

| accepted

Load more