Réponse apportée
how do i implement y=nx(n-6) in matlab
n=0:10 x=@(n) n.^2 % ----Example----- y=n.*x(n-6)

plus de 9 ans il y a | 0

Réponse apportée
extract large text from cell to put it into multiple cells in excel
Use xlsread to import your excel file, then do what you want with it

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
how to generate vector by selecting from another vector?
%-----------Example------------- n=10 r=4 A=randi(10,1,n) %------The code---------- AA=sort(A) a = AA(1); bb=AA(2:end) ...

plus de 9 ans il y a | 0

Réponse apportée
help with this question
nn=3 mm=(0:nn-1)*2+1

plus de 9 ans il y a | 0

Réponse apportée
Return row numbers of look up matrix
x = [10 20;21 30; 31 40]; y = [35;15]; a=bsxfun(@ge,y',x(:,1))&bsxfun(@le,y',x(:,2)); [out,~]=find(a)

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
How to find a scalar that contains the average value of the first output?
Change this A = mean(M(:))

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
Add zero to make length divisible by 3
id=mod(-numel(A),3) A(end+1:numel(A)+id)=0

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
Find Min, Max and Avg of a field
[maxval,index]=max([carMatrix.mileage])

plus de 9 ans il y a | 1

Réponse apportée
Axis change - Is it possible to get the data of the new plot?
Changing the view will not change your data. If you want to get your data from the plot plot(1:10) h=findobj('type','line'...

plus de 9 ans il y a | 1

Réponse apportée
copying matrix values based on another matrix value in MATLAB
u=A(F==-1,:)

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
What is wrong with my code?
idx=sub2ind(size(N),1:n, 1:n) M=N(idx)

plus de 9 ans il y a | 0

Réponse apportée
Not sure how to ask this, but here's my scenario:
x = {'a', 'b' 'a', 'c' 'a', 'b' 'b', 'c' 'c', 'a' 'a', 'd'} v=regexp('a':'d','\S','match') [~,jj]=i...

plus de 9 ans il y a | 0

Réponse apportée
Compare column vector to matrix
B = -5 + (5+1)*rand(73,615) A = -5 + (5+1)*rand(73,1) id=bsxfun(@le,B,A) for k=1:size(id,1) ii=find(id(k,:),1) ou...

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
What other command can I use instead of isempty?
Use ismember(B,A)

plus de 9 ans il y a | 0

Réponse apportée
loop for clock each step is 20 min how to code this
*Edit* a=datenum('13:00','HH:MM') b=datenum('20:00','HH:MM') jj=a:(1/(24*3)):b date1=datestr(jj,'HH:MM') date2=datestr(...

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
Generating a random binary matrix with conditions
A=zeros(5) [n,m]=size(A) for k=1:m id=randperm(n,randi(n)) A(k,id)=1 end

plus de 9 ans il y a | 0

Réponse apportée
Remove duplicates and original also
[ii,jj,kk]=unique(A) out=ii(accumarray(kk,1)==1)

plus de 9 ans il y a | 0

Réponse apportée
Remove duplicates and original also
A = [1,2,2,2,3,3,3,4,5] b=unique(A,'stable') c=hist(A,b) B=b(c==1)

plus de 9 ans il y a | 0

Réponse apportée
how to store the matrix into dat file.
A=rand(3,5) fid=fopen('file.dat','w') fprintf(fid,[repmat('%f ',1,4) '\r\n'],A) fclose(fid)

plus de 9 ans il y a | 0

Réponse apportée
Sprintf not supported with c codegen. Which is the workaround?
You can use num2str

plus de 9 ans il y a | 0

Réponse apportée
excel x & y
If M is your matrix M=[0.5310 0.5103;0.5320 .5080;0.5330 0.5144] x=0.5310 idx=ismember(M(:,1),x) y=M(idx,2)

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
Vectorized method to filling in array based on logical array
*Edit* in_vec = [1,2,3,4,5] in_arr = [0,0,0,0,0; 0,1,1,1,0; 0,0,1,1,0] out_arr =zeros(size(in_arr')) out_arr(logical(in_...

plus de 9 ans il y a | 2

| A accepté

Réponse apportée
How to sum binary sub pixels from 150x150 pixels?
A=randi([0 1],150) % Example b=mat2cell(A,75*ones(2,1),75*ones(2,1)) out=cellfun(@(x) sum(x(:)),b) If you have Image Pro...

plus de 9 ans il y a | 0

Réponse apportée
create a new matrix with combining two matrices with the same size
C=B C(~any(A,2),:)=0

plus de 9 ans il y a | 1

| A accepté

Réponse apportée
Extract data from multidimensional cell array
yourcellarray=arrayfun(@(x) randi(10,randi(20),9),1:50,'un',0) %--Example----- out=cellfun(@(x) mean(x,2),yourcellarray,'un'...

plus de 9 ans il y a | 1

| A accepté

Réponse apportée
How can I fix the error:Subscript indices must either be real positive integers or logicals of the code given below
Check your indices, In Matlab the indices should be positive integers, or logical

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
addtodate creates too many milliseconds
Use linspace a=linspace(0,1-addtodate(0,1,'millisecond'),86400000);

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
Splitting up and N size array into parts
Use matcell, look at this example N=randi(100,100,1) B=mat2cell(N,10*ones(10,1),1)

plus de 9 ans il y a | 0

Réponse apportée
I want to do element comparison between two matrices
A=[1 2 3 4 5 6]; B=[0.1 1 1.5 4.5 4 2.5 2 4] BB=permute(B,[1 3 2]) C=bsxfun(@ge ,A,BB) for k=1:numel(B) out(k)...

plus de 9 ans il y a | 1

| A accepté

Réponse apportée
How can I place all the values less than 1 into a new array
x = [ 1 2 3 4 5 6 0 1 0 4 0 8 0 8 6 0] out=x(x<1) you can calculate y=setdiff(x,out)

plus de 9 ans il y a | 0

| A accepté

Charger plus