Answered
For Error: ??? Index exceeds matrix dimensions.
Check the sizes of your arrays

12 years ago | 0

Answered
Exponential Function in degrees
You can write |exp(i*teta) as cos(teta)+i*sin(teta)| In derees it will be |cosd(teta)+i*sind(teta)|

12 years ago | 0

| accepted

Answered
I'm not sure what is wrong with this code regarding the sin and cos function.
You can check the value of cos(90*pi/180) and compare it with 10^(-20)

12 years ago | 1

Answered
How to solve this ERROR: Output argument "psi" (and maybe others) not assigned during call to "...".
When all the conditions don't match, the variable psi is empty, maybe you should initialize your variable psi to what is neede...

12 years ago | 0

| accepted

Answered
How to read the 3rd column in a line and skip if value is greater than E+37
fid = fopen('file.txt'); res={}; while ~feof(fid) res{end+1,1} =fgetl(fid); end fclose(fid); res(~cellfun('isempty',re...

12 years ago | 0

Answered
How to get transfer function?
You can use <http://www.mathworks.com/help/simulink/slref/linmod.html linmod command> it allows to get a continuous-time linear...

12 years ago | 0

Answered
Hi community, I am ploting a figure and i want to center the figure in the plot
Just use plot(d(:,1),d(:,2))

12 years ago | 0

Answered
how to run a .exe file from matlab
!yourfile

12 years ago | 1

Answered
how to import and combine multiple.mat files into one big matrix??
*EDIT* for k = 1:numfiles mydata{k} = data(k).name; data{k}=load(mydata{k}) end

12 years ago | 0

Answered
conversion from simulation time to real time
Look at this example t=0:300 y=sin(0.1*t) tn=60; t_new=linspace(0,60,numel(t)) plot(t_new,y)

12 years ago | 0

Answered
how to retrieve a part from a cell array ?
A=num2cell(1:10) B=A(1:2:end)

12 years ago | 0

| accepted

Answered
Bar function examples do not work
Probably you've used bar as a variable. Try this clear bar subplot(3,1,2), bar(0:.25:1,rand(5),1)

12 years ago | 1

Answered
simple plotting in matlab
x=1:1:30 h=70 y=h./x plot(x,y)

12 years ago | 0

| accepted

Answered
Get index of rows containing text in a column
[a,b,v]=xlsread('exampleTable_Matlab.xlsx') c3=v(:,3) idx=strcmp(c3,'x') To ignore case, use |strcmpi|

12 years ago | 0

| accepted

Answered
How to convert hex number '0' to binary when it is at first place in a bit stream
s='0123' b=strjoin(cellfun(@(x) dec2bin(hex2dec(x),4),regexp(s,'.','match'),'un',0),'')

12 years ago | 0

| accepted

Answered
How can I get the values of two colums in a matrix that are between a given values?
ii=M(:,1)<V1 & M(:,1)>V2 & M(:,2)<V3 & M(:,2)>V4 out=find(ii,2)

12 years ago | 0

| accepted

Answered
Running a Matlab script from Excel
I know that you can call a Matlab function from your Excell file. Transform your script to a function

12 years ago | 0

Answered
plot pdf for a large size sequence
A=[1 1 1 1 1 1 2 2 2 2 3 3 3] [a,b,c]=unique(A) out=accumarray(c,A') % corresponding to a' [a' out]

12 years ago | 0

| accepted

Answered
Changing Array Elements with logical indexing
B = [ 1 5 8]; B(logical([0 0 1])) = 1000;

12 years ago | 1

| accepted

Answered
Is it possible to tune 2 PID controllers ?
Since your system you want to control is not linear, the behavior of your PID is unpredictable, what you need to do is Step1...

12 years ago | 0

Answered
is it possible to square every element in equation ?
syms a b c d s = (a+b+c.*d) t=symvar(s); out=subs(s,t,t.^2)

12 years ago | 1

| accepted

Answered
How can a draw a line between two points?
plot(x, average,'-o', 'MarkerEdgeColor', 'b', 'MarkerFaceColor', 'b'); hold on plot(x, average_2,'-o', 'MarkerEdgeColor', '...

12 years ago | 1

Answered
Autocorrelation Function of a time variant function
The variable acf is not defined

12 years ago | 0

Answered
The script will read in image files (jpg) into a “cell” array then display them
im=imread('filename.jpg'); imshow(im)

12 years ago | 0

Answered
replace NaN values with numericl values
If you want to replace the nan values by 0 for example A(isnan(A))=0

12 years ago | 15

| accepted

Answered
Counting an element in Matrix
sum(A,2)

12 years ago | 0

Answered
Reading multiple number of an EXCEL file without knowing number of rows and columns
To read all the rows just write [a,b,c]=xlsread('filename.xls')

12 years ago | 0

Answered
How to filter the rows i donot want in a matrix
*Edit* A=[1 1 0;0 2 0;1 0 0;1 0 1] n=size(A,1); k=1; while k<n if any(all(bsxfun(@le,A(k,:),A(k+1:end,:)),2)) A(...

12 years ago | 1

| accepted

Answered
Taking the first element of each matrix
A=[1 2 3] B=[2 3 4] out={sprintf('A%d',A(1)), sprintf('B%d',B(1))}

12 years ago | 0

| accepted

Answered
how to run the simulink model for defined time
The time it takes to run a simulink model depends on the complexity of your model. If you have a small model, even you set the s...

12 years ago | 0

| accepted

Load more