回答済み
Operands to the || and && operators must be convertible to logical scalar values.
Presuming FS and Depth are vectors, then you need to subscript them as, for example if FS(i) < 1 && Depth(i)<20 in all expres...

約7年 前 | 0

回答済み
Plotting dates as text in the x-axis
To plot as ordinal position in the array instead of in order (what else could plot do with actual values on an axis with numeric...

約7年 前 | 1

回答済み
Referencing a position for a subplot
title(sprintf('Hourly Variations for Hour %d Demand',n))

約7年 前 | 0

| 採用済み

回答済み
Calculating Percentile from a pdf
If I interpret the want correctly...let z,v be your two columns--then ecfn=ecdf(v); % empirical cumulative distribution ...

約7年 前 | 0

| 採用済み

回答済み
How to filter data from a timetable based on a string value?
Probably something like isfixed=contains(tt.assets,'fixedinc'); % if string or cell string, should locate tt(isfixed,:) ...

約7年 前 | 1

| 採用済み

回答済み
Problem Loading a Design Matrix File
The first error message tells you precisely why it's happening -- the third line of the file doesn't have the same number of val...

約7年 前 | 0

回答済み
Create aditional legend on bar chart
Oh, the infamous bar again! What a difficult implemtation it is to do anything with... :( Believe it or not, you must do somet...

約7年 前 | 1

| 採用済み

回答済み
Change Colors of bar chart
Your variable Figure is the handle of the figure, not the handle of the bar object you're trying to manipulate. You'll have to ...

約7年 前 | 1

回答済み
variables are not saved in workspace after function.
It can't--you don't return anything. Read about functions at https://www.mathworks.com/help/matlab/ref/function.html

約7年 前 | 1

回答済み
Comparison of FFT codes
Compare size(S) between the two cases and you'll see the difference--and do you see why there is that difference? The differen...

約7年 前 | 0

| 採用済み

回答済み
Select largest elements of each row of a matrix while keeping the position of the values
Use MATLAB vector syntax--no loops needed (or wanted! :) ) -- nHALF=fix(size(ACWI,2)/2); [~, ixPos] = maxk(ACWI.Scores.Carbon,...

約7年 前 | 0

| 採用済み

回答済み
Can I run my script on multiple files sequentially according my existing file name at once
In your function you need to remove the hardcoded path and pass the qualified filename you built in your looping script-- funct...

約7年 前 | 0

| 採用済み

回答済み
Legend title won't display correctly.
OK, I see I overlooked the needed (albeit hidden) property that needed most to get where you want to go... Try exploring from t...

約7年 前 | 0

| 採用済み

回答済み
find peaks and distance between the x axis
Actually, I reversed the order of arguments when using two in findpeaks in first answer -- the x location is the optional second...

約7年 前 | 0

回答済み
find peaks and distance between the x axis
%load the data from excel xy=xlsread('final.xlsx'); % read the sheet only once x=xy(:,1); y=xy(:,2); % make local va...

約7年 前 | 0

回答済み
find peaks and distance between the x axis
The position is NOT uniformly increasing -- is for most of the data, but not all... >> all(diff(data(:,1))>0) ans = logical...

約7年 前 | 0

回答済み
I have a cell matrix and would like to merge these all columns together vertically. How can I do that?
data=cell2mat(data.');

約7年 前 | 0

| 採用済み

回答済み
Remove non time string values in a time matrix
Use the datetime class is probably easiest...see if tm=datetime(time_mat,'InputFormat','hh:mm:ss.SSS'); % convert to...

約7年 前 | 0

回答済み
How to split up column vector
In general, if you're thinking of starting with vector V and creating subvectors, say, A, B, C, ..., this is a very bad idea. I...

約7年 前 | 1

| 採用済み

回答済み
How to create a matrix (64 X 6) with all numbers from 1 to 64, written by binary code?
D=double(dec2bin(0:63,6))-'0';

約7年 前 | 0

| 採用済み

回答済み
Split 2 lines of a matrix?
B=[A(3:4,:);A]; % create new array keeping old A=[A(3:4,:);A]; % new array replaces/augments old More genericall...

約7年 前 | 0

| 採用済み

回答済み
Dont know what Polyval is here doing :-/
You fit yd2 vs xd1 but then plotted against xd2. One presumes the fit should be against xd2 as well. BUT: A perfect illustrat...

約7年 前 | 2

| 採用済み

回答済み
Why does fplot think my function is not vectorized
Because fplot is just looking at the source code, not the output and it doesn't recognize the reshape operation at the end--only...

約7年 前 | 1

回答済み
How to pick a set of data close to one another
Is the reference fixed/known a priori, computed from the overall dataset...??? Presuming the former above and is xref, and othe...

約7年 前 | 0

| 採用済み

回答済み
How to filter out missing data from a text file with readtable()? Different data types in the same column.
Use the 'TreatAsEmpty' named argument to read the M lines as empty and will return NaN. Then just delete the rows that return i...

約7年 前 | 1

回答済み
How can I use 'regstats' to make a multiple linear regression with more than three predictor variables?
You've asked for a full quadratic model in 5 (not 4) predictor variables. That's a total of 5 quadratic + 5 linear + 9 (4+3+2) ...

約7年 前 | 1

| 採用済み

回答済み
how to split up column vectors into separate vectors from data
Build a ThingNum tracking id variable for each and then use findgroups and splitapply to analyze by group however desired. The...

約7年 前 | 1

回答済み
Calculate area under graph between two points
Start with doc findpeaks the optional output peak widths function with proper WidthReference level should give you all the inf...

約7年 前 | 0

回答済み
Matrix with repetitions of a vector
A=repmat(M,6,4); is what you say literally, but I don't follow what you mean by "with repetitions of the vector A, different to...

約7年 前 | 0

回答済み
I get "index must be a positive integer or logical. " Error, please help
"MATLAB is not C" ... for i=0:1:(c-1) %defining k1,k2 and k3 for each case k1(i)=f(t(i),y(i)); ... Matlab arra...

約7年 前 | 1

さらに読み込む