Answered
how to combine intsructions of comparaison in one instruction
idx=ismember([b,c,d,e],a)

10 years ago | 0

| accepted

Answered
Coordinates matrix to new Matrix
Look at this example M=randi(50,5,5) % Your data map=[2 3;4 1;3 2] % The locations idx=sub2ind(size(M),map) out=M(idx)

10 years ago | 0

Answered
Split one matrix to 2 matrix
B=A(:,1) C=A(:,2) Read the <http://www.mathworks.com/company/newsletters/articles/matrix-indexing-in-matlab.html documenta...

10 years ago | 2

| accepted

Answered
how to truncate specific rows and columns of matrix in matlab.
A(2,:)=[] A(:,2)=[]

10 years ago | 1

| accepted

Answered
How to make a column of elements in a cell array be empty cell elements??
x = [cell(4,1) num2cell(rand(4))] Or maybe you want x=num2cell(rand(4)) x(:,1)={[]}

10 years ago | 2

| accepted

Answered
how can we apply logical or operation on character strings
Your_list={'cat' 'dog' 'horse' 'sparrow' 'swallow' 'dove'} You can associate to each element a number that indicate if it's...

10 years ago | 0

Answered
Is mat2huff existed im matlab tools? If existed in which version of Matlab?
You can check it in Matlab documentation <http://www.mathworks.com/help/>

10 years ago | 0

Answered
Conversion of cell element to double
a={'123456789 a' '455'} b=regexp(a,'\d+','match') c=cellfun(@(x) str2double(x{1}),b)

10 years ago | 0

| accepted

Answered
Repeating elements in an array,accessing elements
You need to use cell arrays c={'111' '101' '100'} d=repmat(c,3,1) d=d(:)' if you want to access any digit d{2}(3)...

10 years ago | 0

Answered
Deleting rows with identical values in determined columns of two matrices.
a = [2009,10,2,2,0,0,0,0; 2009,10,2,2,0,0,0,0; 2009,10,9,5,0,0,0,0] b = [2012,10,9,5,1,2,3,4; 2009,10,9,5,3,9,7,1; 2012,10,9,...

10 years ago | 1

| accepted

Answered
Removing rows with identical values in four columns.
a = [2009,10,9,5,0,0,0,0 2009,10,2,5,3,8,7,7 2009,10,9,5,2,1,9,1 2004,10,9,5,2,1,9,1 2004,10,9,5,2,1,9,1 ...

10 years ago | 1

| accepted

Answered
How can I create a string vector?
You can use cell arrays, for example: planet={'planet1' 'planet2' 'planet3' 'planet4'} vector=[2,4,3] our=planet(vector)...

10 years ago | 0

Answered
How to remove particular row
If A is your cell array and b the uncomon list A={'Tool1' 'Mek' 'Ar' 10.0 40.5 'Tool1' 'Lahi' 'BM2' 13.0 89.4 ...

10 years ago | 0

| accepted

Answered
How to read a plot from an image?
You can use imread to read it as an image.

10 years ago | 0

Answered
2D plot x-y axis
You have 3 variables x,y and z, I think you need a 3D plot plot3(x,y,z) Unless you want to change the transparency of th...

10 years ago | 0

Answered
how to arrange an array elemets to unique pairs?
X={'a1', 'b2', 'c3', 'd4'}; ii=1:numel(X) jj=nchoosek(ii,2) A=X(jj(:,1))' B=X(jj(:,2))'

10 years ago | 0

| accepted

Answered
count the number of new listings and delistings across time
p2 =[ NaN 2 4 NaN NaN NaN 1 1 NaN NaN NaN 3 1 1 NaN 1 4 NaN ...

10 years ago | 0

| accepted

Answered
Find array elements that meet a condition an put them in a secondary array
ll=find(A>0.5) [ii,jj,kk]=ind2sub(size(A),ll) out=[ii,jj,kk,A(ll)]

10 years ago | 0

Answered
finding most common letter in a string
y='asdqwdqwdasasdasdaasasdwdqwd' [ii,jj,kk]=unique(y) a=accumarray(kk,1) idx=a==max(a) out=ii(idx)

10 years ago | 0

Answered
Finding multiple locations in a vector
a=ismember(A,B) b=find(a)

10 years ago | 0

Answered
multi dimension colon operation
cumsum(matrix_in)

10 years ago | 2

Answered
Replicating a vector while summing an increasing value
a = [ 7 8 9 7 8 9]; bsxfun(@plus,a,10*[1:5]')

10 years ago | 0

Answered
How to calculate number of times a pair appear in an array
data=[1 2;4 5;1 2;7 8;1 2;4 5] [ii,jj,kk]=unique(data,'rows') out=[ii histc(kk,1:size(ii,1))]

10 years ago | 1

| accepted

Answered
Why is MyCellArray{:} different than x = MyCellArray{:}?
a={rand(600,1) ;rand(600,1)} b=cellfun(@mean,a)

10 years ago | 0

Answered
split binary array based on value 1
a = [ 1 0 0 0 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0]'; ii1=strfind(a',[1 0]); ii2=strfind([a' 1],[0 1]); out=ar...

10 years ago | 0

Answered
Manipulating data in Cell Arrays
If data is your matrix out=str2double(cellfun(@(x) regexp(x,'\d+','match'),data))

10 years ago | 0

| accepted

Answered
if statemnt do not execute the second statement
if 0<T & T<10 h=T-10 elseif T>100 h=0.45*T+900 end

10 years ago | 0

| accepted

Answered
Plotyy scatter adapt dotes
x=0:0.1:1; y1=sin(x); y2=cos(x); [ax,h1,h2]=plotyy(x,y1,x,y2,'scatter') set(h1,'markerfacecolor','r') set(h2,'markerfacec...

10 years ago | 4

| accepted

Answered
delete certain rows from a matrix
q = [1 0 0 0; 2 3 4 5; 6 7 8 9] w = [1 0 0 0] q=setdiff(q,w,'rows') or q = [1 0 0 0; 2 3 4 5; 6 7 8 9] w = [1 0 0...

10 years ago | 0

Answered
I keep getting x as a single value output instead of an array of 14values..
Replace / by ./ x=((1+((a.*(wl).^2)./(((wl).^2)-((k1)^2)))+((b.*(wl).^2)./(((wl).^2)-((k2)^2)))+(c.*((wl).^2)./(((wl).^2)-(...

10 years ago | 0

| accepted

Load more