Answered
how to convert the format of images from '.jpg' to '.tif' format. Images are stored in a folder
folder='D:/Matlab/' ;% For example f=dir([folder '*.jpg']); for k=1:numel(f) old_file=f(k).name; new_file=strrep...

13 years ago | 0

Answered
white space in cell array
s={'aa a aa'; 'a aaaa a'; 'a = aaaaa'} out=cellfun(@(x) x(~ismember(x,' ')),s,'un',0)

13 years ago | 0

Answered
How do i use any numeric value as a symbol?
s='4580=80%' If it's not what you are looking for, please be more clear

13 years ago | 0

Answered
Imorting data from text file
This is not a good idea, you can save all your data in one cell array filename={'amit.txt','ankit.txt','anmol.txt'} for k=...

13 years ago | 0

Answered
runing an exe file with respectly inputs
You have to use other then Matlab interface to display or introduce data, for example inputdlg function a=inputdlg('enter ...

13 years ago | 0

Answered
Setting a Variable value as Label in Plot
xlabel(file_name)

13 years ago | 0

Answered
how to read th ode45 iteration time
[T,Y] = ode45(odefun,tspan,y0) % T is the time vector

13 years ago | 0

Answered
Search data in a dataset array
Use list1 = find(strcmp(result_test.Temp, cond1))

13 years ago | 0

| accepted

Answered
Puzzler for a Monday
idx=strcmp(A,B) out=[A(~idx) A(idx)]

13 years ago | 2

Answered
Simulink Red Wires. Why?
This happen when two block can not be connected. Maybe you are using simscape where certain component can not be directly conne...

13 years ago | 0

Answered
Use zero-order-hold in Fixed step simulation.
You can not use a ZOH sample time which is not a multiple of Ts. You have to adjust your simulation step time.

13 years ago | 0

| accepted

Answered
Mcc command is not showing any C compiler
If your os is 64 bit, you should choose your compiler by mex -setup

13 years ago | 0

Answered
Subscript indices must either be real positive integers or logicals
You have probably used sum as a variable in your code. Check it by typing sum

13 years ago | 1

Answered
Reaching the array read from .txt file
for k=1:n filename=sprintf('data%d',k); data=load(filename); data0=data.(filename) %do end

13 years ago | 0

Answered
pole placement in M-file
p is the poles vector you have to impose to your system in closed loop. Example: A=[-6 -5;1 0]; b=[1;0] The size of ...

13 years ago | 0

Answered
Why error using cell2mat ?
A={ 1 , 2 ; [], 4}; cell2mat(A); The result Error using cat Dimensions of matrices being concatenated are not consis...

13 years ago | 1

| accepted

Answered
Undefined function or variable in MATLAB
The variable Hydrogene is not defined in your code, how Matlab will recognize it?

13 years ago | 0

Answered
assign parameter values with sim command
Use <http://www.mathworks.com/help/simulink/slref/set_param.html set_param> function <http://www.mathworks.com/matlabcentral...

13 years ago | 0

| accepted

Answered
How can I enter values into a workspace
A=[1 2 3;4 5 6;7 8 9]

13 years ago | 0

| accepted

Answered
I would like to know the syntax for plotting two y axes and single x axis for multiple line plots..
ax1=axes('color','none','YAxisLocation','left') ax2=axes('color','none','YAxisLocation','right') plot(x3,y3,'b',x2,y2,'b',x1...

13 years ago | 0

| accepted

Answered
datenum input string format
d='2012-06-01T03:15:00Z' out=datestr(datenum(d,'YYYY-mm-ddTHH:MM:SS'),'YYYY-mm-dd HH:MM:SS')

13 years ago | 1

Answered
how to pass data of a cell to matrix??..
Example a={{1} {2} {3}} out=horzcat(a{:})

13 years ago | 0

Answered
datenum input string format
d='2012-06-01T03:15:00Z' a=regexp(d,'[^T Z]+','match') b=datestr(datenum(horzcat(a{:}),'yyyy-mm-ddHH:MM:SS')) % or ...

13 years ago | 1

Answered
How to find column and row indexes of items that are +-inf or Nan ?
A=[inf 1 4 nan;4 -inf 2 nan]; % Example [ii,jj]=find(isnan(A)| isinf(A)) You can also use logical indexing, which is faste...

13 years ago | 1

| accepted

Answered
Store data in cell arrays
i2=[1 1 0 0 1 1 1 1 0 0 1 1 0 0 0 1 1 0 1]; a=[i2(1) diff(i2)]; idx1=find(a==1); idx2=find(a==-1); if numel(idx2)<numel...

13 years ago | 0

Answered
How to convert cell to matriz
This is because your cell are not the same size Example A={[1 2], 2 , [4 5;3 2]} cell2mat(A) % will give an error

13 years ago | 0

Answered
finding location of numbers in matrix
id=arrayfun(@(x) find(A(x,:)>300),(1:size(A,1))','un',0)

13 years ago | 0

Answered
regarding the conversion of rgb to gray scale
If you have an array A with dimension mxnx3 size(A,1)=m size(A,2)=n size(A,3)=3 To use rgb2gray your array should be m...

13 years ago | 0

Load more