Answered

for loops not working

"The MATLAB way" is to avoid the loops altogether... N=10; M=1000; [X,Y]=meshgrid([1:N],1:M]); func=(X*pi/Lx).^2 +(Y*pi/Lz).^...

for loops not working

"The MATLAB way" is to avoid the loops altogether... N=10; M=1000; [X,Y]=meshgrid([1:N],1:M]); func=(X*pi/Lx).^2 +(Y*pi/Lz).^...

environ 14 heures ago | 0

Answered

How can I shift the elements in a vector without losing the elements? just shift the order

Sorta' inconsistent definition, but look at >> A=1:10; >> circshift(A(4:end-2),-2) % case 1 ans = 6 7 ...

How can I shift the elements in a vector without losing the elements? just shift the order

Sorta' inconsistent definition, but look at >> A=1:10; >> circshift(A(4:end-2),-2) % case 1 ans = 6 7 ...

1 jour ago | 0

Answered

How to transform an array into a bottom triangle

On the above assumption, if V is the vector, then N=149; % array size parameter R=V(cumsum([N:-1:1])); ...

How to transform an array into a bottom triangle

On the above assumption, if V is the vector, then N=149; % array size parameter R=V(cumsum([N:-1:1])); ...

2 jours ago | 0

Answered

Finding elements of an arrays having specified index numbers

Given you return the indices in vectors ix and iy, then V=A(sub2ind(size(A),ix,iy)); where A is the other array and V will be ...

Finding elements of an arrays having specified index numbers

Given you return the indices in vectors ix and iy, then V=A(sub2ind(size(A),ix,iy)); where A is the other array and V will be ...

2 jours ago | 1

Answered

Use the index of an element of a subset to find its index in the large set?

tipPt=[2 3 2]; % the two located points smpPt=[2 3 1]; % return their locations in the two arrays, respectively ...

Use the index of an element of a subset to find its index in the large set?

tipPt=[2 3 2]; % the two located points smpPt=[2 3 1]; % return their locations in the two arrays, respectively ...

2 jours ago | 0

| accepted

Answered

vertical error bar in loglog plot

hEB=errorbar(x,A,err); hAx=gca; hAx.XScale='log'; hAx.YScale='log'; You'll have to have defined the error magnitude array, e...

vertical error bar in loglog plot

hEB=errorbar(x,A,err); hAx=gca; hAx.XScale='log'; hAx.YScale='log'; You'll have to have defined the error magnitude array, e...

2 jours ago | 0

| accepted

Answered

Having multiple lines in a character array for column labels in a heatmap

Unless TMW has finally fixed it, the TickLabel interpreter is pretty brain dead...you can do something like ColumnLabels=strrep...

Having multiple lines in a character array for column labels in a heatmap

Unless TMW has finally fixed it, the TickLabel interpreter is pretty brain dead...you can do something like ColumnLabels=strrep...

2 jours ago | 0

| accepted

Answered

Replace categorical value with numeric values

If categorical variable is c, then d=double(c)-1; presuming didn't define them except by default which will be in alphanumeric...

Replace categorical value with numeric values

If categorical variable is c, then d=double(c)-1; presuming didn't define them except by default which will be in alphanumeric...

4 jours ago | 0

Answered

i need to compare a matrix with a static table

> [interp1(Y(:,1),Y(:,2),X(:,1)) interp1(Z(:,1),Z(:,2),X(:,2)) interp1(A(:,1),A(:,2),X(:,3))] ans = 279.6900 255.4500 247....

i need to compare a matrix with a static table

> [interp1(Y(:,1),Y(:,2),X(:,1)) interp1(Z(:,1),Z(:,2),X(:,2)) interp1(A(:,1),A(:,2),X(:,3))] ans = 279.6900 255.4500 247....

4 jours ago | 0

| accepted

Answered

how to find peak frequency value in the ionogram which is from power data (for every height and transmitting frequency )of digisonde data

See doc findpeaks

how to find peak frequency value in the ionogram which is from power data (for every height and transmitting frequency )of digisonde data

See doc findpeaks

4 jours ago | 0

Answered

msgbox is not displaying the string entered in body

Should be msgbox('Message','Title')

msgbox is not displaying the string entered in body

Should be msgbox('Message','Title')

4 jours ago | 0

Answered

Generate beta random number without statistics toolbox

Given Ui are uniform random variates Y1=U1/α1 and Y2=U1/β1, such that Y1+Y2<=1, then X=Y1/(Y1+Y2) follows the beta dist...

Generate beta random number without statistics toolbox

Given Ui are uniform random variates Y1=U1/α1 and Y2=U1/β1, such that Y1+Y2<=1, then X=Y1/(Y1+Y2) follows the beta dist...

6 jours ago | 0

| accepted

Answered

how to fit a a curve using gamma fit

See doc gamfit but all the inflection points in the green curve have no chance to be reflected in a fitted function.

how to fit a a curve using gamma fit

See doc gamfit but all the inflection points in the green curve have no chance to be reflected in a fitted function.

7 jours ago | 0

Answered

Randomly assign a value to each column of a matrix

Not way subscript expansion works as written...use seqS(sub2ind(size(seqS),[1:mt].',t)) = true; instead

Randomly assign a value to each column of a matrix

Not way subscript expansion works as written...use seqS(sub2ind(size(seqS),[1:mt].',t)) = true; instead

7 jours ago | 0

| accepted

Answered

Accessing Character Vectors Within Cell Arrays, Output Is Size of Character Vector, not Contents?

While not your specific question, couldn't help but recast your function using standard MATLAB functions for various operations ...

Accessing Character Vectors Within Cell Arrays, Output Is Size of Character Vector, not Contents?

While not your specific question, couldn't help but recast your function using standard MATLAB functions for various operations ...

7 jours ago | 0

Answered

Moving mean in matrix

% Identify the columns that contain at least one 999999 isKey = matriz_media == key; colIdx = find(any(isKey,1)); ...

Moving mean in matrix

% Identify the columns that contain at least one 999999 isKey = matriz_media == key; colIdx = find(any(isKey,1)); ...

7 jours ago | 0

Answered

how do you get the max y value in an fplot?

Look at the documentation and see what else you can do with fplot... fp=fplot(mu,[0 100]); [mxMu,imx]=max(fp.YData); % ...

how do you get the max y value in an fplot?

Look at the documentation and see what else you can do with fplot... fp=fplot(mu,[0 100]); [mxMu,imx]=max(fp.YData); % ...

7 jours ago | 0

Answered

3D plotting help

Per the documentation for scatter3, scatter3(X,Y,Z,S,C) draws each circle with the color specified by C. If C is a RGB triple...

3D plotting help

Per the documentation for scatter3, scatter3(X,Y,Z,S,C) draws each circle with the color specified by C. If C is a RGB triple...

8 jours ago | 0

| accepted

Answered

Renaming batch names removing extensions

Job for command. Make a .cmd batch file from the following--name DORENAME.CMD or somesuch... echo off setlocal for %f in (18...

Renaming batch names removing extensions

Job for command. Make a .cmd batch file from the following--name DORENAME.CMD or somesuch... echo off setlocal for %f in (18...

9 jours ago | 0

| accepted

Answered

Plotting fresh plot for every iteration and change x-direction

Some basic "issues"... Your figure line is figure(6) which always reverts to the same figure you requested so it's not surprisi...

Plotting fresh plot for every iteration and change x-direction

Some basic "issues"... Your figure line is figure(6) which always reverts to the same figure you requested so it's not surprisi...

9 jours ago | 1

| accepted

Answered

How can I modify appearence of multiple plots?

Save the errorbar object returned handles and set properties as desired.

How can I modify appearence of multiple plots?

Save the errorbar object returned handles and set properties as desired.

10 jours ago | 1

| accepted

Answered

Convert 1x2 double to 1x1 string

>> string(sprintf('[%d,%d]',s)) ans = "[3,7]" >> or, with features built into the new string class that mimic VB in ma...

Convert 1x2 double to 1x1 string

>> string(sprintf('[%d,%d]',s)) ans = "[3,7]" >> or, with features built into the new string class that mimic VB in ma...

10 jours ago | 1

| accepted

Answered

How do I change datetime format in stackedplot on X-Axis?

hAx=gca; hAx.TickLabelFormat='hh:mm:ss'; You can set the XTick values as wanted but there will not possibly be room to label m...

How do I change datetime format in stackedplot on X-Axis?

hAx=gca; hAx.TickLabelFormat='hh:mm:ss'; You can set the XTick values as wanted but there will not possibly be room to label m...

10 jours ago | 0

Answered

How to write Multiple data to Excel

xlswrite is documented to accept one array for output...you've got two disparate pieces of data to place in the spreadsheet--you...

How to write Multiple data to Excel

xlswrite is documented to accept one array for output...you've got two disparate pieces of data to place in the spreadsheet--you...

10 jours ago | 0

Answered

Loop for extracting a matrix

nAvg=10; mnAV=reshape(mean(reshape(av,nAvg,[])),[],2); Same caveat w/ Guillaume; errors if not divisible by nAvg and the final...

Loop for extracting a matrix

nAvg=10; mnAV=reshape(mean(reshape(av,nAvg,[])),[],2); Same caveat w/ Guillaume; errors if not divisible by nAvg and the final...

10 jours ago | 0

Answered

Calculate the hourly battery capacity

... B_Energy_t(i)=B_Energy_t(i-1)+delta_B_t(i); if B_Energy_t(i)>(R_B*A_B) B_Capacity_t(i)=R_B*A_B; if B_Energ...

Calculate the hourly battery capacity

... B_Energy_t(i)=B_Energy_t(i-1)+delta_B_t(i); if B_Energy_t(i)>(R_B*A_B) B_Capacity_t(i)=R_B*A_B; if B_Energ...

10 jours ago | 1

| accepted

Answered

writetable with spaces on header

You will have to write the table content via fprintf then; the writetable function doesn't have the flexibility to specify alter...

writetable with spaces on header

You will have to write the table content via fprintf then; the writetable function doesn't have the flexibility to specify alter...

11 jours ago | 0

Answered

How can I plot 2 graphs with errorbar each one?

Use errorbar and hold on or as per the documentation, if y is a matrix errorbar plots a separate line for each column.

How can I plot 2 graphs with errorbar each one?

Use errorbar and hold on or as per the documentation, if y is a matrix errorbar plots a separate line for each column.

12 jours ago | 1

| accepted

Answered

how to separate strings from a datatable?

As the error message says, strsplit only operates on the strings class or char arrays--it can't handle either cell strings (the ...

how to separate strings from a datatable?

As the error message says, strsplit only operates on the strings class or char arrays--it can't handle either cell strings (the ...

13 jours ago | 0

Answered

skip lines starting with a special character and assign data to variables

fid=fopen('yourfile.txt','r'); fmt='%f'; data=cell2mat(fid,fmt,'commentstyle','%')); Do the assignment to variables either by...

skip lines starting with a special character and assign data to variables

fid=fopen('yourfile.txt','r'); fmt='%f'; data=cell2mat(fid,fmt,'commentstyle','%')); Do the assignment to variables either by...

13 jours ago | 0