Answered
fft, problem in determining sampling frequency
There is no default sampling frequency for fft function. You provide your samples without specifying your sample time, and fft f...

14 years ago | 0

Answered
eleminating data from a long vector
A=rand(1,1000); % Example index=[10 100 500] idx=arrayfun(@(x) x:x+30,index,'un',0); A(cell2mat(idx))=[]

14 years ago | 0

| accepted

Answered
For loop dies in the middle of solving
The problem can be caused by u(:,(i/delta_t)+1) Are you sur that |i/delta_t| is real positive integer or logical

14 years ago | 0

Answered
Complex number and degrees
Because of precision problem with pi sin(pi)=1.2246e-16 and sind(180)=0

14 years ago | 0

| accepted

Answered
How to pick specific excel columns in matlab
num=xlsread('file.xls','T9:T20') plot(num)

14 years ago | 0

Answered
Variable Output to Text File
Try dlmwrite('filename',cell2mat(mycell),'delimiter',' ')

14 years ago | 0

Answered
Filter matrix rows based on value of function in Matlab
n=size(A,1); A(arrayfun(@(x) expression(A(x,:)),(1:n)','un',0))=[]

14 years ago | 1

Answered
how to use load function??
filename='yourfile' load(filename)

14 years ago | 0

Answered
HOW TO COMPARE TWO ARRAYS ELEMENTS IN MATLAB
aa = [0.2, 0.3, 0.2, 0.1, -0.1, -0.2, -0.3, nan] bb = [nan, 0.1, 0.2, 0.3, 0.2, 0.1, -0.1, -0.2] idx=arrayfun(@sign ,aa.*bb...

14 years ago | 1

| accepted

Answered
How can I change the name of a variable and assign to it the name of a mat file?
for k=1:10 filename{k}=sprintf('file%d',k) end Will generate |file1, file2,...,file10|

14 years ago | 0

Answered
how to use sum?
%They both work fine %What is your error message? %Try clear sum n=1:20; sum(n./2.^n) Mybe sum is used as a vari...

14 years ago | 0

| accepted

Answered
error using ode45 from dynamic simulation
What is *l* in: |xout(2) = k*x(3)/J -m*g* *l* *sin(x(1))/J -b*x(2)/J;|

14 years ago | 1

Answered
How to provide a delay in seconds from an external block to a pulse generated by another block?
Use a <http://www.mathworks.com/help/simulink/slref/unitdelay.html *unit delay*> block

14 years ago | 0

| accepted

Answered
How do you insert a changing variable into an input command?
for k=1:5 x(k)=input(sprintf('Enter value of %d state',k)) end

14 years ago | 2

| accepted

Answered
Xlswrite and copy&paste uitable column names
col=get(t,'columnname')' % t is the handle of your table data=get(t,'data') num=[col;data] xlswrite('file.xls',num)

14 years ago | 0

Answered
need help Writing a function that returns roots of a quadratic
There are some mistakes if a==0 %instead of if a=0 elseif % instead of ifelse

14 years ago | 0

Answered
Do I have to download the entire list of programs and such to do homework?
If you mean, How to learn Matlab, you do not have to download any program. You have, at first, to learn basics of Matlab. You ca...

14 years ago | 0

Answered
I wanna know, how can I get the position of a given value in a matrix
A =[1 0 0; 0 1 0] idx=find(A==1) % Linear index % The linear index of your matrix is, in this order % [1 3 5 ...

14 years ago | 0

| accepted

Answered
cell2struct is running during execution in command window but not in program
Maybe raw is not a cell number in your script. In your m-file type this class(raw) and make comment % a=cell2stru...

14 years ago | 1

Answered
I want to solve some coupled differential equations using ode45, but here I have to pass some constants in that function as well. How will the code be written.
function dy=yourfunction(t,y,k,g) % k, g are your constants %your code To call ode45 [t,y]=ode45(@(t,y) yourfun...

14 years ago | 0

| accepted

Answered
How do I change from Cell to String?
[Array{1} Array{2} ]

14 years ago | 0

Answered
how to stimulate a lowerpass filter in simulink?
Try to change the sample time of your blocks, from 0 to -1

14 years ago | 0

Answered
Minimum Block from Simulink
If your vector comes from a constant block, for example, you can use *matlab function* block where you will put a code below: ...

14 years ago | 0

| accepted

Answered
how to convert matlab code to .exe file?
No, your .exe application, needs only MCR.

14 years ago | 1

Answered
How can i find any matlab function definition?
# To find the definition of any Matlab function, just type in Matlab windows ommand: help yourfunction doc yourfunction ...

14 years ago | 0

Answered
Stem(Array) is graphed wrong (off by one). Index error?
C=[.9 .1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] stem(0:19,C,'r') |stem(C)| % you did not specify the x-axis value. The def...

14 years ago | 0

Answered
How to delete text files except one.?
yourfolder='d:/test/'; f=dir([yourfolder '*.txt']) f={f.name} n=find(strcmp(f,'file.txt')); f{n}=[] for k=1:numel(f); ...

14 years ago | 5

| accepted

Answered
Create a row vectors that includes even/odds between 0 and X
x=10; y=20; v=x+1:y-1 v_even=v(mod(v,2)==0) v_odd=v(mod(v,2)~=0)

14 years ago | 2

| accepted

Answered
Mean of Cells of Cells
Try this *Edit* %-----------Your array-------------------------------------------------- Y1={num2cell(rand(16,107)),num...

14 years ago | 0

| accepted

Answered
Simulink "Goodness" Block, Function to Coefficeint
Yes, you can use *interpreted matlab function* block or *matlab function* block

14 years ago | 0

Load more