Answered
size of matrices in a struct
A loop is involved, yes, but you can write it w/o coding the loop explicitly. Part depends upon just what it is you want; what ...

6 years ago | 0

Answered
Create a single average day out of hourly data (33days)?
"First row is date second is hourly mean temp." That would be column, not row, as just a nit. Yes, either groupsummary or varf...

6 years ago | 0

| accepted

Answered
Stress testing to find parameters uncertainty
See some previous answers to the question... <<Answers/415341> and <Answers/120978> The comments by @SK go to the question of ...

6 years ago | 0

| accepted

Answered
Unusual size of saved variable as .mat file
"I expect ,the size of this structure ... not to be much much bigger than my data..." That's perhaps a reasonable expectation o...

6 years ago | 0

| accepted

Answered
any suggests, solutions ?
Jeremy is correct... ncparamteres.m would contain: %ncparamteres.m % Script to create variables in the calling MATLAB works...

6 years ago | 0

Answered
How can I find the best curve of a set of curves to fit data points?
How can there be a question of "which one is best"? You have a physical model and one constant, k, to estimate so a least squar...

6 years ago | 0

Answered
How to create a fit like 1/(x^n)
Of course, the above can be linearized by log transform... b=polyfit(log10(x),log10(y),1); >> b(1), 10^b(2) ans = -1.44...

6 years ago | 1

| accepted

Answered
Merge a selected rows to creat a single row
EDITED for ROW ORDER CORRECTION -- dpb function X=reshapeNperRow(x,Nper) % X = reshapeNperRow(x,Nper) % reshapes input array ...

6 years ago | 1

| accepted

Answered
Append lines to interrupted CSV file by calculating new values while ignoring lines that have text information
Functional, but somewhat more in the MATLAB spirit...using vectorized operations in contains function and input/output... chrs...

6 years ago | 0

Answered
How can i convert my data into matrix vectors?
dataExp=[2741.8, 2760.5, 3006.8, 3140.8, 3422.6, 3854.6, 4424.6, 4699.4, 4922.4, 5596]; dataNum=[2721.9, 2753.8, 2989, 3122.2, ...

6 years ago | 0

Answered
''Unable to perform assignment because the left and right sides have a different number of elements.''
ts(1)=t(max(find(f1>=tolerance))); and friends can return an empty RHS if no element satisfies the condition.

6 years ago | 0

Answered
How to add hat symbol to "xtick"
Have to escape LaTex sequences with "$$" before and after...try something like hAx=axes; xlim([1 3]); xticks([1:3]) % a samp...

6 years ago | 2

| accepted

Answered
How to plot a polynomial function, having the ordinate coordinates symmetrical about the abscissa (horizontal line)
Well, it's not too hard to get reasonably close...you don't have enough points on yours for the smooth line...the following code...

6 years ago | 0

Answered
find minimum value of a two-variable equation on an interval.
"...is there anyway I can delet[e] the dot but the equation can still work?" Ah! Indeed I didn't follow along the nub of the q...

6 years ago | 0

| accepted

Answered
Hiding Plot Elements makes those elements appearing in the legend and the legend itself a much lighter shade than it should be. How to fix this?
OK, wasn't too hard to take yours and make an example... figure(1) colormap jet hAx(1) = subplot(5,5,[1,2,6,7]); yyaxis le...

6 years ago | 0

| accepted

Answered
Write multiple vectors into .dat file
Simplest, presuming they're the same length would be to write as 2D array. I'd write as column instead of row.. writematrix([x...

6 years ago | 1

| accepted

Answered
Extract numbers from lines in a txt file. Onset times from experimental data.
Carrying on from the above that just diddled with the file format to be able to get the data; the following seems to work: file...

6 years ago | 0

| accepted

Answered
log-log plot explained
You have created such...what's the problem? Probably the issue is that your data don't cover a sufficient range in either x or ...

6 years ago | 0

| accepted

Answered
Extract numbers from lines in a txt file. Onset times from experimental data.
The problem is the file contains double-byte characters and ML isn't interpreting them ... >> txt=importdata('Imagine_simple-1-...

6 years ago | 0

Answered
Create a logistical variable based on time range
readtable is a convenient byway on the way to a timetable which will undoubtedly be your friend... tt=readtable('Forum_aq_data....

6 years ago | 0

| accepted

Answered
Plotting an array of vectors
Your data are nothing at all like that of the other figures; hence it's not surprising they don't plot similar-looking graphs. ...

6 years ago | 0

Answered
Sum across columns with shift
May be some other more clever indexing, but the "deadahead" thing that comes to mind if I understand the desire >> a=1:18;a=res...

6 years ago | 1

| accepted

Answered
Scatter Plot with different "markers" and "data labels"
Adam posted first but will add slightly different way to get to same place (sans some of the finishing niceties...) Why scatter...

6 years ago | 1

Answered
How to reshape an array in a specific manner
>> reshape(a,3,[]).' ans = 1 2 3 1 2 3 1 2 3 1 2 3 >>

6 years ago | 0

| accepted

Answered
How can I get information that a 'uisave' command was aborted?
No can do. Less than primo "Quality of Implemenation" that TMW didn't have an optional return value from uisave >> fn=uisave('...

6 years ago | 0

| accepted

Answered
How to sort a vector according to another vector?
R=['a':'d'].'; % So can identify elements of R % the engine [~,ix]=sort(ranks); % the result... >> R(ix) ans = 4×1 char...

6 years ago | 0

| accepted

Answered
Question on why tilde cannot return the opposite statement result
Q4_ans_test2 = mean( adultdata.hours_per_week(adultdata.age>30 & ~(adultdata.age>50))); Without the parentheses, the ~operator ...

6 years ago | 1

Answered
Fractions as array indices in for loop
Short answer? "Because!" TMW hath so decreed. I'm sure it's mostly performance related as well as ease of code development an...

6 years ago | 0

Answered
row from matrix by argument
m=randi(200,4) % sample data m = 125 95 46 63 118 47 35 185 42 169 46 87 ...

6 years ago | 0

| accepted

Load more