Answered
Finding position of a string in a cell array
s={'AGGH' '' 'ANYN' '' 'AYBK' '' 'AYDU' '' 'AYGB' } find(strcmp(s,'ANYN' ))

10 years ago | 11

| accepted

Answered
How should the variable declared in popup menu be called in pushbutton call back function . Can anybody help me out with this? Please. Thank you Deepa
What is the aim of this? set(handles.popupmenu1, 'UserData') Maybe you want set(handles.popupmenu1, 'UserData',Valu...

10 years ago | 0

Answered
How do I split my 200 pixel image up into 8 by 8?
A=rand(200) p=1:25:200 [ii,jj]=ndgrid(p,p) out=arrayfun(@(x,y) A(x:x+24,y:y+24),ii,jj,'un',0)

10 years ago | 0

Answered
Perform Operation on only even rows.
A=randi(9,10,4) idx=2:2:size(A,1); Ae=A(idx,:) Ae1=circshift(Ae,[0 -2]) A(idx,:)=Ae1

10 years ago | 0

| accepted

Answered
Monthly Average for Large Dataset
If your text file looks like 2000 02 01 1001 25 25 2000 02 01 2310 45 46 2000 03 02 1121 33 36 2000 03 02 1141 33 36 2...

10 years ago | 1

Answered
How to add zeros to 2 x vectors where there are no matches, to get the same length ?
n=max(numel(x),numel(x1)) x=[x zeros(1,n)] x1=[x1 zeros(1,n)] y=[y zeros(1,n)] y1=[y1 zeros(1,n)]

10 years ago | 0

Answered
How to change variable name in each loop iteration?
This is a bad idea <http://matlab.wikia.com/wiki/FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA10_in_a_loop.3F> But if you...

10 years ago | 1

Answered
how to rotate X Tick Label ?
The xticklabelrotation property is not supported by versions before Matlab R2014b. However you can find some application in File...

10 years ago | 1

| accepted

Answered
Where i find complete list of matlab commands and functions. Specially array manipulations
<http://www.mathworks.com/help/matlab/functionlist-alpha.html>

10 years ago | 4

| accepted

Answered
Combine ascii files of different size
Lon= [-180 10] Lat= [-90 0 60] Depth= [1 2 3 4 5 6] [ii,jj]=ndgrid(Lon,Lat); out=[ii(:) jj(:) Depth']

10 years ago | 1

| accepted

Answered
troble in applying for loop
k=0 h=zeros(size(1:5:numel(S))) for ii=1:5:numel(S) k=k+1 h(k)= phi_sync(ii) + phi_acc(ii); ...

10 years ago | 0

| accepted

Answered
Identifying a repeating number in a large data file
A function that finds these numbers is <http://www.mathworks.com/help/matlab/ref/find.html find> Example: A=[1 2 3 9 4 ...

10 years ago | 0

| accepted

Answered
Transition Matrix that compares two elements to the next two elements.
a=[1 2 1 1 1 2 2 2 1 1 1 2 2]; b=[0 1 0 0; 0.5 0 0 0.5; 1 0 0 0; 0.5 0 0.5 0]; state=[1 1;1 2;2 1;2 2]; q=zeros(4); for k=...

10 years ago | 0

| accepted

Answered
How to read a *.csv file where the numbers are in quotes ("1","2", ...)?
[a,b,c]=xlsread(yourfile) s=regexp(b,'[\d.]+','match') out=str2double(cellfun(@(x) x{:},s,'un',0))

10 years ago | 0

| accepted

Answered
How can I give a different legend for each element of a vector in a scatter plot?
A=[1:3]; B=[9:11]; figure; hold on for k=1:numel(A) scatter(A,B,'facecolor','b') end hold off legend({'a','b','c'})

10 years ago | 1

Answered
shade area under a semilog plot
Use H1=area(log10(freq),pnoise)

10 years ago | 0

Answered
Oversampling in PID tuning
# The best way to do what? # Your PID is continue or discrete? # How about the system you are controlling?

10 years ago | 0

Answered
Load file with certain number
r=sprintf('%d',A(4)-1) data=load(r)

10 years ago | 0

| accepted

Answered
How to convert a cell array of cell arrays to matrix ?
C={{1 3 4};{1 3 3}} out=cell2mat(cellfun(@(x) cell2mat(x),C,'un',0))

10 years ago | 3

| accepted

Answered
How to find out the TimeUnits?
get(sys,'TimeUnit') Or sys.TimeUnit

10 years ago | 1

| accepted

Answered
MATLAB : compare hours (hh:mm:ss)
x = {'05:05:05', '05:05:06', '05:05:09', '05:05:10'} p='05:05:07' xx=datenum(x) pp=datenum(p) [~,idx]=min(abs(xx-pp)) ou...

10 years ago | 0

| accepted

Answered
Focus plot and apply correct tick labels
Look at this example t=0:0.1:10 y=8*rand(size(t))-4 plot(t,y) ylim([-1 1]) xl=xlim nt=8 % number of ticks xt=linspac...

10 years ago | 0

| accepted

Answered
How to run program once for every new image stored in folder?
folder='C:\FTP\testing2' type='*.jpg' srcFiles = dir(fullfile(folder,type)); for ii= 1 : length(srcFiles) fi...

10 years ago | 0

Answered
Set and reset Simulink
Try this function z=fcn(x,reset) persitent xx if isempty(xx) xx=0 end if (x==7|xx==1) & reset==0 z = 6; ...

10 years ago | 0

| accepted

Answered
How to store the result of a For Loop in an Array ?
Read the documentation, you will find examples <http://www.mathworks.com/help/matlab/matlab_prog/loop-control-statements.html>

10 years ago | 1

Answered
shade area under curve between 2 x-axis limits
x=0:pi/50:2*pi; y1=x.^2; H1=area(x,y1); hold on idx=x>3&x<4; H=area(x(idx),y1(idx)); set(H(1),'FaceColor',[1 0.5 0]); ...

10 years ago | 3

| accepted

Answered
How to define variable block in Simulink ?
Maybe you want a <http://www.mathworks.com/help/simulink/slref/matlabfunction.html Matlab function block>

10 years ago | 0

Answered
Organizing dates and values using simple matrices
*Edit* %-----------------Example------------------------ A=[ {'year' 'month'} genvarname(repmat({'day'},1,31),'day');repma...

10 years ago | 1

Answered
How can i use the values obtained in a functional file in another file?
Read about <http://www.mathworks.com/help/matlab/ref/function.html functions>

10 years ago | 0

Load more