Answered
label a matrix according to another label matrix
A=[1 1 1 1; 1 1 2 3; 3 2 1 4] B=[0 0 1 1] C=ismember(A,find(B))

11 years ago | 1

Answered
sum of squared elements in a matrix
1.3056e+010 is 1.3056 * 10^10

11 years ago | 0

| accepted

Answered
How to make a new matrix with all common arrays from different matrices
m1 = [1;2;3;4;5;6;7;8]; m2 = [2;3;4;6;7;8;9;10;11;12]; m3 = [4;5;6;7;8;9;1;;16]; m4 = [8;8;5;4;3;1;6;7]; a=intersect(m1,m2...

11 years ago | 0

Answered
simulink switch (for a single use)
You can use <http://www.mathworks.com/help/simulink/slref/matlabfunction.html Matlab function block> with the code: y=funct...

11 years ago | 0

| accepted

Answered
Finding nearest local max. and min. of a polynomial function
you can use findpeaks function

11 years ago | 0

Answered
Creating new array from individual string outputs
end [num1,excel1,raw1] = xlsread('excel1'); [num2,excel2,raw2] = xlsread('excel2'); end names1 = excel1(:,1)...

11 years ago | 1

| accepted

Answered
When I calculate exp(3.8566e5*1i) and exp(data*1i) answers are different why? Here, data=3.8566e5
Why are yoy surprised? you are using two different numbers (3.8566 and 3.856). try this Data =3.8566e+005 exp(1i*3.8566e5)...

11 years ago | 0

Answered
Why can't I save very small numbers in a vector?
a=1e-9 fprintf('%.10f',a)

11 years ago | 0

| accepted

Answered
Permutations from two sets of files
a={1;2;3;4} b={'A';'B';'C'} [ii,jj]=ndgrid(1:numel(a),1:numel(b)) out=cellfun(@(x,y) [num2str(x) '-' y ],a(ii(:)),b(jj(:)...

11 years ago | 0

Answered
Question about using fzero to find all real roots of a polynomial
ff=[1 -4.75 10.875 -20.125 20 1.75 -30 25]; out=roots(ff) out=out(imag(out)==0) %or out=out(imag(out)<1e-5)

11 years ago | 0

Answered
Delete rows from text file that do not contain certain numbers
a=importdata('file.txt') a(~ismember(a(:,1),[1010001;1010003],'rows'),:)=[]

11 years ago | 0

| accepted

Answered
finding the maximum and minimum value of specific rows in a cell array
Look at this example a={rand(1877958,8); rand(1251972,8)}; b=cellfun(@(x) reshape([x; repmat(x(end,:),-mod(size(x,1),-60),...

11 years ago | 1

| accepted

Answered
Product of each row with for-loop
v = [1 2 3; 4 5 6]; out=prod(v,2)

11 years ago | 0

Answered
known interation each cell of a matrix
M=[ 5.3 2 6.2 3 7.12 5] out=cell2mat(arrayfun(@(x,y) x*ones(y,1),M(:,1),M(:,2),'un',0))

11 years ago | 0

| accepted

Answered
Are there user built drivers to get DAQ to work on 64 bit MatLab?
Look at this link <http://www.humusoft.cz/produkty/datacq/mf624/>

11 years ago | 0

Answered
removing symbol and numbers from a table
a={'02:02:00';'02:03'} b=cellfun(@(x) x(1:5),a,'un',0) %or b=datestr(datenum(a,'HH:MM'),'HH:MM')

11 years ago | 2

| accepted

Answered
Finding times between binary signals
amp=[1;0;1;0;0;0;0;0;0;1;0;1;0;0;1;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;1;0;1] ii=strfind(amp',[1,0]) jj=strfind(amp',[0,1]) ...

11 years ago | 0

Answered
Is it known that the inv operator in Matlab 2014b is not working correctly?
cond(A) will let you know if your matrix is well conditionned

11 years ago | 1

Answered
How to change 4x4 matrix to 2x2 matrix
A = [1 2 3 4; 2 3 4 5; 3 4 5 6; 4 5 6 7] [n,m]=size(A) [ii1,jj1]=ndgrid(1:2:n,1:2:m) out=arrayfun(@(x,y) mean(mean(A(x:x+1,...

11 years ago | 0

Answered
How to find only negative root of any polynomial
r=roots(your_array) r=r(r<0))

11 years ago | 0

Answered
Normalizing a gray scale image to the range [0,1]
a = mat2gray(yourimage)

11 years ago | 1

Answered
How to add a header line to txt file?
O = [2,1 0;4,6 0;2,10 0;6,800 0]; fid = fopen('Output.txt', 'wt'); s=regexp(sprintf('header%d ' , 1:size(O,2)),'\S+','match...

11 years ago | 0

| accepted

Answered
How can I create a matrix from my current data.
data=reshape(A,60,24)'

11 years ago | 0

Answered
Summing all the Matrices in a Cell Array?
a={rand(7,2) rand(7,2) rand(7,2)} % This is an example b=sum(cat(3,a{:}),3)

11 years ago | 4

| accepted

Answered
How to get first 3 maximum number in a matrix
n=sort(m) n=n(end:end-2)

11 years ago | 1

Answered
how to delete particular row in given matrix ?
c=setdiff(b,a,'rows')

11 years ago | 0

| accepted

Answered
a proble with saving data with index
You can do it this way data_to_be_saved=[1 2 4; 5 6 7] sweepnr=1 str=['height_' num2str(sweepnr) '= data_to_be_saved'] ...

11 years ago | 0

| accepted

Answered
Copy numbers by its position on cells from a textdata
time={'12:11:23.4' '12:11:23.8' '12:11:24.0' '12:11:24.6' '12:11:25.2'} out=cellfun(@(x) str2num(x{1}),r...

11 years ago | 1

| accepted

Answered
How to find minimum element from an array.
a=[132 784 94 35 567] b=min(a)

11 years ago | 0

| accepted

Answered
Fastest way to compute J' * J, where J is sparse
c=sparse(J); H=full(c*c');

11 years ago | 0

Load more