Answered
random number generator help
Suppose |N=[0.11 0.23 0.25 0.05 0.5]| N>=0.2 The result is 0 1 1 0 1 If you multiply the result by 2 you will ...

12 years ago | 0

| accepted

Answered
How to average certain elements in a matrix using for loop.
A=[ 1 2 10;5 8 10;4 3 20] c1=A(:,1); c2=A(:,2); [ii,jj,kk]=unique(A(:,3)); cc1=[ii accumarray(kk,c1,[],@mean)] cc2=[ii ac...

12 years ago | 0

| accepted

Answered
Please explain the concept of zeros for images...the code is [m n]=size(image); image1=zeros(8,m,n);
image1=zeros(8,5,2) This line of code allows to pre allocate memory for a matrix 8x5x2, to be used after. you can fill your...

12 years ago | 0

Answered
arrays in loops, changing variable names (i.e. A{1}, A{2}, ...)
I don't see any problem in your code, look at this example for k=1:3 BW=rand(50); s{k} = edge(BW,'canny');...

12 years ago | 0

| accepted

Answered
How can I break down a data matrix of say 1024x961 to 961 single files of 1024x1 matrix with filenames corresponding to the column number?
a=rand(1024,961) % Example for k=1:size(a,2) m=a(:,k); save(sprintf('file%d',k),'m') % save to mat file end Bu...

12 years ago | 0

| accepted

Answered
matrix convertion and reconvertion
a=[1 2 3 4; 5 6 7 8; 9 10 11 12; 13 14 15 16] b=a(:,3:4); c=a(:,1:2); b(2:2:end,:)=fliplr(b(2:2:end,:)); c=...

12 years ago | 0

Answered
using quad wrong or is it removed?
there is a function called ln in Matlab, maybe you mean log F=@(x) log(1+tan(x)); quad(F,0,pi/4)

12 years ago | 0

| accepted

Answered
How Can I Create More Than One Figure
Use hold on % many plot in the same figure Or plot in different figures figure plot(x1,y1) figure plot(x2,y2) ...

12 years ago | 6

Answered
lokal minimum and maximum
You can use findpeaks(y) to find maximums, and findpeaks(-y) to find minimums

12 years ago | 0

| accepted

Answered
How to check the type of input
Use class function s='err' class(s)

12 years ago | 0

Answered
Using one save button(push button) instead of two?
Have you tried a toggle button?

12 years ago | 0

| accepted

Answered
Create a script and cell to group:
help factorial help for

12 years ago | 0

Answered
one's and two's complement
a='11001011'; c1=not(a-'0') % one's complement d=1; for k=numel(a):-1:1 r=d & c1(k); c2(1,k)=xor(d,c1(k)); % c...

12 years ago | 2

| accepted

Answered
Mean of values in the 1st column where the value in the second column is zero
M=[2.5 1;3.2 0] c1=M(:,1) c2=M(:,2) idx=c2==0 out=mean(c1(idx))

12 years ago | 0

Answered
sendmail: Error using sendmail
This line |setpref('Internet','SMTP_Server', 'mydomain.com')| should be setpref('Internet','SMTP_Server', 'smtp.mydomain....

12 years ago | 0

Answered
logicals and replacing values in 3D matrices
[ii,jj]=find(x==2) kk=repmat((1:numel(ii))',1,q)'; idx=sub2ind(size(z),repmat(ii,q,1),repmat(jj,q,1),kk(:)) z(idx)=nan

12 years ago | 0

| accepted

Answered
convert string with digits to double
v={'12:57:33' '36.6' '0.857101' '12:57:51' '37.0' '0.891594' '12:58:37' '37.7' '0.898841' '12:59:49' '38.8' '0.893043'} ou...

12 years ago | 0

Answered
how to split character data in string and double?
str='Time 12:57:33' out=regexp(str,'\d+(\.)?(\d+)?','match')

12 years ago | 0

Answered
How do I correspond locations in a nested structured array to locations inside of its nest?
patient.name = {'John Doe'}; patient.dob = {042557}; patient.date = {040111; 022512}; patient.percentages={ [02 08 09]; [23...

12 years ago | 1

| accepted

Answered
How Can I create a time varying equation in Simulink?
You will need # Math function block # clock block # sum block

12 years ago | 0

Answered
About "system()" command in matlab
folder='E:\matlab' app='your_app' system(fullfile(folder,app))

12 years ago | 0

| accepted

Answered
INTERSECTION BETWEEN 2 IMAGES
[M,ii,jj]=intersect(A,Am)

12 years ago | 0

Answered
How can i delete nth line of a txt file?
Load all the lines then delete the specific lines

12 years ago | 0

Answered
Resample of time series
you can use interp1 function

12 years ago | 0

Answered
read .png from different subfolder
folder='E:\matlab' d=dir(folder) subf=d([d.isdir]) im=[] for k=3:numel(subf) subfolder=subf(k).name subf1=fullfi...

12 years ago | 0

Answered
Delete duplicate rows from large cell array
A={'2000-01-10 1:00' 'HCM' '268' '20' '260' '2345' '0' '90' '2000-01-10 1:00' 'HCM' '268' '20' '260' '2345' '0' '90' '2000-0...

12 years ago | 2

| accepted

Answered
How can I pre allocate the memory for a variable? or is it possible?
Sis=zeros(33489,5625)

12 years ago | 0

Answered
reshape a matrix with a divisible of 10....
A=rand(87,1); n=(10-mod(numel(A),10)); n=n*sign(n); A(end+1:end+n)=0; out=reshape(A,10,[]) %or r=10 m=n...

12 years ago | 1

Answered
convert binary vector value into decimal
a= [0 0 1 0 1 0 1 1]; b=bin2dec(sprintf('%d',a))

12 years ago | 0

Answered
error in bit shifting operation
circshift(a,[0 -2])

12 years ago | 0

| accepted

Load more