回答済み

Function inside for loop that calls multi-column variables

Vectorize the function instead..."the MATLAB way" function [d1km]=latlondist(LL1,LL2) RADIUS=6371; LL1=deg2rad(LL1); L...

Function inside for loop that calls multi-column variables

Vectorize the function instead..."the MATLAB way" function [d1km]=latlondist(LL1,LL2) RADIUS=6371; LL1=deg2rad(LL1); L...

28日 前 | 0

| 採用済み

回答済み

How to find n number of low value's position or column number from a cell ?

NtoFind=5; [Mn,iMn]=mink(X,NtoFind);

How to find n number of low value's position or column number from a cell ?

NtoFind=5; [Mn,iMn]=mink(X,NtoFind);

29日 前 | 0

回答済み

MATLAB syntax (parantheses without intermediate steps)

Because to date TMW has chosen to not implement post-addressing expressions on results. "WHY?" you'd have to ask TMW and it's u...

MATLAB syntax (parantheses without intermediate steps)

Because to date TMW has chosen to not implement post-addressing expressions on results. "WHY?" you'd have to ask TMW and it's u...

約1ヶ月 前 | 0

| 採用済み

回答済み

rounding to zero small numbers (NOT round function)

No. ML basic numeric type is the floating point double which around zero has roughly the above magnitude of precision. You'll ...

rounding to zero small numbers (NOT round function)

No. ML basic numeric type is the floating point double which around zero has roughly the above magnitude of precision. You'll ...

約1ヶ月 前 | 1

回答済み

How to identify traces in a plot

You could use the 'Tag' line property to add an identifier to each when created or use the legend 'DisplayName' which is also se...

How to identify traces in a plot

You could use the 'Tag' line property to add an identifier to each when created or use the legend 'DisplayName' which is also se...

約1ヶ月 前 | 0

回答済み

saving in a specific text file format

>> fmt='%8.3f,%8.3f\n' fmt = '%8.3f,%8.3f\n' >> fprintf(fmt,A.') 25.000, 10.000 26.000, 9.000 >>

saving in a specific text file format

>> fmt='%8.3f,%8.3f\n' fmt = '%8.3f,%8.3f\n' >> fprintf(fmt,A.') 25.000, 10.000 26.000, 9.000 >>

約1ヶ月 前 | 0

回答済み

how can I find the distance between succesive points in a big matrix

d=diff(xy); % presume 2D array is xy d=hypot(d(:,1),d(:,2)); pdist may be as fast even though computes all p...

how can I find the distance between succesive points in a big matrix

d=diff(xy); % presume 2D array is xy d=hypot(d(:,1),d(:,2)); pdist may be as fast even though computes all p...

約1ヶ月 前 | 0

| 採用済み

回答済み

Boxplot in a specified position in a subplot

... bar(max(kimpute)+1, ... % add boxplot onto right end of axis NX=max(kimpute)+1; % how many locations on ...

Boxplot in a specified position in a subplot

... bar(max(kimpute)+1, ... % add boxplot onto right end of axis NX=max(kimpute)+1; % how many locations on ...

約1ヶ月 前 | 0

| 採用済み

回答済み

How to use findpeaks function to give me the peak maxima within a particular length of time? How to find slopes of peaks?

The first Q? is you just pass the portion of the time series that encompasses whatever time span you wish -- how many points tha...

How to use findpeaks function to give me the peak maxima within a particular length of time? How to find slopes of peaks?

The first Q? is you just pass the portion of the time series that encompasses whatever time span you wish -- how many points tha...

約1ヶ月 前 | 0

回答済み

read certain rows and lines into array from txt file

opt=detectImportOptions('smtony.txt'); % get the base import object opt.SelectedVariableNames=opt.Sele...

read certain rows and lines into array from txt file

opt=detectImportOptions('smtony.txt'); % get the base import object opt.SelectedVariableNames=opt.Sele...

約1ヶ月 前 | 0

回答済み

how can i print an array using fprintf function?

You didn't put but one numeric formatting string in the format; hence, the whole thing repeats as often as needed to output the ...

how can i print an array using fprintf function?

You didn't put but one numeric formatting string in the format; hence, the whole thing repeats as often as needed to output the ...

約1ヶ月 前 | 1

| 採用済み

回答済み

Get data from a Cellstr

On the presumption there's a much larger lookup table in the real application... X=[17,21]; % lo...

Get data from a Cellstr

On the presumption there's a much larger lookup table in the real application... X=[17,21]; % lo...

約1ヶ月 前 | 0

回答済み

Assign a part of file name to a variable

m=str2num(char(extractBetween(myfolderinfo(i).name,'_','.')));

Assign a part of file name to a variable

m=str2num(char(extractBetween(myfolderinfo(i).name,'_','.')));

約2ヶ月 前 | 0

| 採用済み

回答済み

Warning: The assignment added rows to the table, but did not assign values to all of the table's existing variables. Those variables will extended with rows containing default values.

Apparently you had a table with N variables but only assigned values to a subset of those when adding rows. Example: >> x=rand...

Warning: The assignment added rows to the table, but did not assign values to all of the table's existing variables. Those variables will extended with rows containing default values.

Apparently you had a table with N variables but only assigned values to a subset of those when adding rows. Example: >> x=rand...

約2ヶ月 前 | 0

| 採用済み

回答済み

Timestamps on X axis from datetime

You've got to create datenum array to match to plot against for datetick to work correctly. Or you need to plot the x axes usin...

Timestamps on X axis from datetime

You've got to create datenum array to match to plot against for datetick to work correctly. Or you need to plot the x axes usin...

約2ヶ月 前 | 0

回答済み

HOW TO COMBINE TWO CELLS INTO ONE?

As Adam notes, you have two arrays as shown (I took the liberty to reformat the original Q? to make more legible) and there's a ...

HOW TO COMBINE TWO CELLS INTO ONE?

As Adam notes, you have two arrays as shown (I took the liberty to reformat the original Q? to make more legible) and there's a ...

約2ヶ月 前 | 0

回答済み

How to plot a graphic with different markers in a scatter plot?

"plot each "9 dots" in the graphic with "different marker.". Not each group." Wow. But, ok...that's simpler with plot than it ...

How to plot a graphic with different markers in a scatter plot?

"plot each "9 dots" in the graphic with "different marker.". Not each group." Wow. But, ok...that's simpler with plot than it ...

約2ヶ月 前 | 0

回答済み

How to create pseudo x-axis (or y-axis) tick labels?

With the background as to "why", basic idea would be something like Ratio=100/3; % the divisor for modifying the actual ...

How to create pseudo x-axis (or y-axis) tick labels?

With the background as to "why", basic idea would be something like Ratio=100/3; % the divisor for modifying the actual ...

約2ヶ月 前 | 0

| 採用済み

回答済み

Why is the or statement making something true?

"Am I doing something wrong with the | as or?" Yes you are...the above is the same as if Overall_max_score==(scores(1,3)|score...

Why is the or statement making something true?

"Am I doing something wrong with the | as or?" Yes you are...the above is the same as if Overall_max_score==(scores(1,3)|score...

約2ヶ月 前 | 0

回答済み

change datatype of x axes

Axes are not polymorphic--they require a given data type. You'll have to create two axes and select which to display depending ...

change datatype of x axes

Axes are not polymorphic--they require a given data type. You'll have to create two axes and select which to display depending ...

約2ヶ月 前 | 1

| 採用済み

回答済み

Function with structure field syntax

"You can also call a method using dot notation....It is not necessary to pass the object explicitly as an argument when using d...

Function with structure field syntax

"You can also call a method using dot notation....It is not necessary to pass the object explicitly as an argument when using d...

約2ヶ月 前 | 0

| 採用済み

回答済み

How to extract text from string at the same location, one line above

Presuming have read the file into a string array, s, >> isOK=contains(s(find(contains(s,"12345"))-1),"999") isOK = logical...

How to extract text from string at the same location, one line above

Presuming have read the file into a string array, s, >> isOK=contains(s(find(contains(s,"12345"))-1),"999") isOK = logical...

約2ヶ月 前 | 0

回答済み

how to set NaN values red in a figure ?

I guess you could interpolate to fill in the NaN locations and then scatter3 them on top of the surf w/ the red marker...otherwi...

how to set NaN values red in a figure ?

I guess you could interpolate to fill in the NaN locations and then scatter3 them on top of the surf w/ the red marker...otherwi...

約2ヶ月 前 | 0

| 採用済み

回答済み

Plotting data as a function of time

For the given description, yes. BUT, you should probably create your date vector as one of the datetime or duration class inste...

Plotting data as a function of time

For the given description, yes. BUT, you should probably create your date vector as one of the datetime or duration class inste...

約2ヶ月 前 | 1

| 採用済み

回答済み

Simple linear regression, prediction intervals behave strangely using predint

It's the use of the ''observation','on' for the simultaneous bounds that's causing the much wider prediction interval bounds. N...

Simple linear regression, prediction intervals behave strangely using predint

It's the use of the ''observation','on' for the simultaneous bounds that's causing the much wider prediction interval bounds. N...

約2ヶ月 前 | 0

回答済み

How to find the mean peaks in positive axis

thresh=0; % or whatever level you wish pks = findpeaks(y,'MinPeakHeight',thresh); Read the doc carefully; findpeaks has all...

How to find the mean peaks in positive axis

thresh=0; % or whatever level you wish pks = findpeaks(y,'MinPeakHeight',thresh); Read the doc carefully; findpeaks has all...

2ヶ月 前 | 0

| 採用済み

回答済み

Combining multiple plot statements.

As is, the above code snippet leaves only the result of plot((1-sqrt(5)),0,'g^', 'MarkerFaceColor', 'g') on the figure because...

Combining multiple plot statements.

As is, the above code snippet leaves only the result of plot((1-sqrt(5)),0,'g^', 'MarkerFaceColor', 'g') on the figure because...

2ヶ月 前 | 0

回答済み

MinPeakDistance ignoring some peaks it shouldn't

See <Answers 482540: Logic of findpeaks> for what's behind the cause for this. You'll have to modify your search pattern to loo...

MinPeakDistance ignoring some peaks it shouldn't

See <Answers 482540: Logic of findpeaks> for what's behind the cause for this. You'll have to modify your search pattern to loo...

2ヶ月 前 | 0

| 採用済み

回答済み

probem with FaceColor of bar

Carrying on from the above after defining data... clrs=[[1 0 0];[0 1 0];[1 1 1];[0 1 1];[0 0 1];[1 1 0];[0 0 0];[1 0 1]]; % rgb...

probem with FaceColor of bar

Carrying on from the above after defining data... clrs=[[1 0 0];[0 1 0];[1 1 1];[0 1 1];[0 0 1];[1 1 0];[0 0 0];[1 0 1]]; % rgb...

2ヶ月 前 | 1