Answered
finding location of numbers in matrix
[ii,jj]=find(A>300)

13 years ago | 0

Answered
reading a number from a string
str='(0020,0013) IS [98] # 2, 1 InstanceNumber' pattern='(?<=\[)\d+(?=\])' out=regexp(str,pattern...

13 years ago | 0

| accepted

Answered
deleting part of a string
original='dogcat_1_12334' new=regexp(str,'[a-z]+','match']

13 years ago | 0

Answered
Finding the end date of each month in my own sequence of dates
dat=datevec(dates) [~,idx]=unique(dat(:,1:2),'rows','last') res=dates(idx)

13 years ago | 0

| accepted

Answered
c2d continuous time to discrete time with changing sampling time
For each sample time, you will get a new system sysd1=c2d(sys,Ts1) sysd2=c2d(sys,Ts2) ... and so on

13 years ago | 0

Answered
Searching for a string in a very efficient way
Instead of |ismember(B, A)|, You should use ismember(A,B);

13 years ago | 0

| accepted

Answered
How can I add new data to specific row and colum of a matrix
*EDIT* B= [1 2 5; 3 4 6; 7 8 9] n1=2 %Position of the row to add m1=3 %position of the column to add %------------------...

13 years ago | 0

| accepted

Answered
Comparing two elements in cell.
Look at this link <http://www.mathworks.com/matlabcentral/answers/57444-faq-why-is-0-3-0-2-0-1-not-equal-to-zero>

13 years ago | 0

| accepted

Answered
Find distance between to elements of a "circular" vector
v = [6 7 1 3 9 6 8 10] a1=7; id1=2 a2=10 % number to find vi1=[v v] ii1=find(vi1==a2)-id1 idx1=min(ii1(find(ii1>0))) vi...

13 years ago | 1

Answered
Two colors, one vector
x = -4*pi:0.001:4*pi; y=sin(x); y2=y; y2(y2>=0)=nan; plot(x,y ,'r',x,y2,'g');

13 years ago | 0

| accepted

Answered
How can I match my dates?
You can create 3653 days for your data, then remove the weekends from your array. s1=datenum('01/01/2000','dd/mm/yyyy')...

13 years ago | 0

Answered
How to replace certain values in an array without using for-loop?
A(ismember(A,B))=0

13 years ago | 0

Answered
How to write data statistics of a graph, into an excel file?
Use xlswrite function doc xlswrite

13 years ago | 0

Answered
efficient way of transforming vector
B=cell2mat(arrayfun(@(x) x*ones(A(x),1),1:numel(A),'un',0)') %or a for loop which is much faster B=[] for k=1:numel(A...

13 years ago | 1

Answered
Importing large binary information
fid = fopen('file.txt'); line1 = fgetl(fid); res={line1}; while ischar(line1) line1 = fgetl(fid); if ischar(line1...

13 years ago | 2

| accepted

Answered
How can I compare an input value to coefficients in a cell array?
a={10 30 50 0 20 60 70 80}; idx=find(cellfun(@(x) x>20,a)) values=a(idx) %or idx=find(cell2mat(a)>20) values=a(id...

13 years ago | 0

Answered
Matrix formed by Vectors?Easy question.
v=[1 2 3;4 5 6;7 8 9] v1=v(:,1) % first column v2=v(:,2) v3=v(:,3) % horizontal concatenation v=[v1 v2 v3]

13 years ago | 0

Answered
sector of a circle
x0=2; y0=3; r=10; % radius angl=3*pi/4; angl=rem(angl,2*pi); if angl<=pi x=r*cos(angl):0.01:r+x0; y...

13 years ago | 1

Answered
Time-range simulation in Simulink
You must change some setting in your scope properties: click on your scope properties, then choose history and uncheck *limit...

13 years ago | 0

Answered
how to find a vector in a known set of possibilities
Use the function below to find all possibilities function y=arrangement(v,n) m=length(v); y=zeros(m^n,n); for k...

13 years ago | 0

| accepted

Answered
How to call global function?
You can use global function

13 years ago | 0

| accepted

Answered
how to initiate a table in matlab
You can use uitable function, look at this link <http://www.mathworks.com/help/matlab/ref/uitable.html>

13 years ago | 0

Answered
how to find out number of rows in particular matrix of the cell?
out=cellfun(@(x) size(x,1),a)

13 years ago | 0

Answered
Mathworks xPC Target CAN drivers for MPC555??
I think you should contact the <http://www.mathworks.com/support/contact_us/index.html;jsessionid=2e43ca6eb8cb4c6117cb8bf1bcba M...

13 years ago | 0

Answered
finding values from matrix
out=A(A>45) If you want the location: idx=find(A>45) % corresponding indices out=A(idx)

13 years ago | 2

Answered
Create a pop-up meesage
You can create an Editbox and set it to invisible in the opening function set(handles.Editbox1,'visible','off') When the...

13 years ago | 1

Answered
random integer between 0 and 15 with equal probability
B1= ceil(b + (B+1-b) * rand)-1

13 years ago | 1

Answered
Problem 32. Most nonzero elements in row
I don't know what should be the result r, but I can see that the value of r is erased each loop r=rows maybe you can ini...

13 years ago | 0

Answered
How to delete spaces and '[ ', ']' characters from all data array string cells?
a={'',1 ,[],'22'} a(cellfun('isempty',a))=[]

13 years ago | 1

Answered
Multiple X-axes non linear to each other
If your vectors are x, y and z plot3(x,y,z) In your case plot3(distnace,angle,data) %or maybe you are looking fo...

13 years ago | 0

Load more