Réponse apportée
Convert Time(string) to Time(number)
A little bit circuitous as for some reason TMW doesn't let one create a duration array from scanning text...why is beyond my ken...

environ 7 ans il y a | 0

Réponse apportée
how to identify matlab identify a cell(title) in excel and use it as a variable.
Matlab turns column header text into allowable variable names by using the underscore to fill in spaces and appending suffix int...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
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...

environ 7 ans il y a | 0

Réponse apportée
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...

environ 7 ans il y a | 1

Réponse apportée
Referencing a position for a subplot
title(sprintf('Hourly Variations for Hour %d Demand',n))

environ 7 ans il y a | 0

| A accepté

Réponse apportée
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 ...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
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,:) ...

environ 7 ans il y a | 1

| A accepté

Réponse apportée
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...

environ 7 ans il y a | 0

Réponse apportée
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...

environ 7 ans il y a | 1

| A accepté

Réponse apportée
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 ...

environ 7 ans il y a | 1

Réponse apportée
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

environ 7 ans il y a | 1

Réponse apportée
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...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
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,...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
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...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
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...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
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...

environ 7 ans il y a | 0

Réponse apportée
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...

environ 7 ans il y a | 0

Réponse apportée
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...

environ 7 ans il y a | 0

Réponse apportée
I have a cell matrix and would like to merge these all columns together vertically. How can I do that?
data=cell2mat(data.');

environ 7 ans il y a | 0

| A accepté

Réponse apportée
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...

environ 7 ans il y a | 0

Réponse apportée
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...

environ 7 ans il y a | 1

| A accepté

Réponse apportée
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';

environ 7 ans il y a | 0

| A accepté

Réponse apportée
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...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
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...

environ 7 ans il y a | 2

| A accepté

Réponse apportée
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...

environ 7 ans il y a | 1

Réponse apportée
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...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
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...

environ 7 ans il y a | 1

Réponse apportée
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) ...

environ 7 ans il y a | 1

| A accepté

Réponse apportée
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...

environ 7 ans il y a | 1

Réponse apportée
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...

environ 7 ans il y a | 0

Charger plus