Réponse apportée
How to use a code to get the corresponding value of a loop in another file
Your outer loop range is 0:45:360 but you only set a value for the struct environment for those values less than 360. What is i...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
trapz whe x is a matrix
TMW only implemented variable X spacing for the full array, not by column (or row). Have to loop to do it...worthy of an enhanc...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
Weekly Average per Year For Loop
No loops should be needed. If you haven't convert the date data to ML datetime and then compute the grouping variable wkyr as ...

plus de 6 ans il y a | 0

Réponse apportée
Begginer's Question about matrixes
press=Ps*(1+(Lb/Ts)*altitude).^(-g0*M/R*Lb); dp=diff(press); "The Matlab way" is to use the vectorized abilities built into op...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
Function doesn't return a vector from a vector input
Yes, you didn't read about logical IF if Ffork0+Inc_Ffork*t <= Ffork_max is True iff every element of Ffork0+Inc_Ffork*t is <=...

plus de 6 ans il y a | 1

Réponse apportée
Unspecified coefficients from function 'fit'
fit returns a fit object (either cfit or sfit, depending on curve or surface). There are functions to return things out of the ...

plus de 6 ans il y a | 0

Réponse apportée
Mean of a subset of columns for every row
N=10; M=reshape(mean(reshape(Data.',N,[])),size(Data,2)/N,[]).';

plus de 6 ans il y a | 1

| A accepté

Réponse apportée
how to set stacked bar graph legend?
Did you try legend('A','B','C') ???

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
Hello , I have an issue with getting everything to show on my figure correctly. I made four subplots but for some reason my 4th subplot is not showing and also the legend, text and title is not showing correctly either
You plot() BEFORE you create the subplot; so the first plot is killed/destroyed after it is made when the subplot(2,2,1) call i...

plus de 6 ans il y a | 2

| A accepté

Réponse apportée
Title for each table in one figure
Whole lot of code to wade through but the first little bit is just N = 15; Alpha0=0.05; alpha=Alpha0./(N:-1:1); I don't do G...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
Copying arrays from another file
You don't "copy", you just read each file and catenate the (I presume) 2D array to the third dimension of the initial array. d=...

plus de 6 ans il y a | 0

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

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
How to find n number of low value's position or column number from a cell ?
NtoFind=5; [Mn,iMn]=mink(X,NtoFind);

plus de 6 ans il y a | 0

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

plus de 6 ans il y a | 0

| A accepté

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

plus de 6 ans il y a | 1

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

plus de 6 ans il y a | 0

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

plus de 6 ans il y a | 0

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

presque 7 ans il y a | 0

| A accepté

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

presque 7 ans il y a | 0

| A accepté

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

presque 7 ans il y a | 0

Réponse apportée
read certain rows and lines into array from txt file
opt=detectImportOptions('smtony.txt'); % get the base import object opt.SelectedVariableNames=opt.Sele...

presque 7 ans il y a | 0

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

presque 7 ans il y a | 3

| A accepté

Réponse apportée
Get data from a Cellstr
On the presumption there's a much larger lookup table in the real application... X=[17,21]; % lo...

presque 7 ans il y a | 0

Réponse apportée
Assign a part of file name to a variable
m=str2num(char(extractBetween(myfolderinfo(i).name,'_','.')));

presque 7 ans il y a | 0

| A accepté

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

presque 7 ans il y a | 0

| A accepté

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

presque 7 ans il y a | 0

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

presque 7 ans il y a | 0

| A accepté

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

presque 7 ans il y a | 0

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

presque 7 ans il y a | 0

| A accepté

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

presque 7 ans il y a | 0

Charger plus