回答済み
How to save fig in a different folder
mydir='yourfullyqualifiedpath'; savefig(figure(1),fullfile(mydir,'results','h.fig'),'compact'); The above also has the hardcod...

4年以上 前 | 0

| 採用済み

回答済み
Create dir using greek symbol
Which OS/file system? Even if it is allowed by the above combination, I would strongly advise against doing so; it'll just lead...

4年以上 前 | 0

回答済み
How do I import quarterly data from Excel
>> tQ=readtable('..\Answers\Data_QFE.xlsx'); >> tQ.Year=datetime(tQ.Year,'InputFormat','uuuuQQQ','Format','uuuuQQQ'); >> head(...

4年以上 前 | 0

回答済み
What is this peak's meaning?
Or, it's just random noise or other non-meaningful artifact; we don't know for sure... How was the frequency axis created to ge...

4年以上 前 | 0

| 採用済み

回答済み
Add x=y line to the scatter plot
hold on plot(xlim,ylim,'-b')

4年以上 前 | 2

| 採用済み

回答済み
Change scale of x-axis on plot
hAx=gca; hAx.XAxis.TickLabelFormat='%d'; hAx.XAxis.Exponent=0;

4年以上 前 | 0

回答済み
Why do upsample and downsample commands give wrong results in start of sequence?
Don't know what the complaint is, precisely? upsample and downsample are working as documented -- >> upsample(1:4,3) ans = ...

4年以上 前 | 0

回答済み
Help trying to manually insert peaks after findpeaks through a radio or push button please!
I'll let you deal with coding the callback to a button, but %...your above code here... hAx=gca; ...

4年以上 前 | 1

| 採用済み

回答済み
How exactly does MATLAB calculate a sum of array elements by its sum() function? Does it use any compensated summation algorithm such as Kahan?
TMW does not document publicly algorithms beyond anything provided in the documentation Description section or, occasionally an ...

4年以上 前 | 1

回答済み
intersect between the second column of cell array A (for all rows) and the first column of cell array B (for all rows)
This may or may not be possible with simple syntax depending upon the content of the cell arrays...if it can work, [H,ih,ik]=i...

4年以上 前 | 0

回答済み
how to merge 2 variable of different size?
With what expected as result, pray tell? You can't have a 2-column matrix of 25-elements; you could keep the two as elements in...

4年以上 前 | 0

回答済み
making the x-axis and y-axis fixed for all plots
If you use x/ylim before plotting and then use plot, the auto-scaling will still be in effect for the axis and plot as the high-...

4年以上 前 | 0

| 採用済み

回答済み
I have a function "f" that returns a 1x2 vector, and I need to make a 3x2 matrix M by stacking the outputs f(x1), f(x2), f(x3) on top of each other, but Matlab won't parse it.
The first syntax will work if the function actually returns a vector -- >> x=rand(1,5); >> fnX=@(i)x(i:i+1); >> fnX(1) ans =...

4年以上 前 | 0

| 採用済み

回答済み
what does the "oldx =[x(n);oldx(1:256)]" in the following programm do?
It will (very inefficiently) append the first 255 elements of the (NEW and this is key) oldx vector onto the value of the read-i...

4年以上 前 | 0

回答済み
Sorting cell for only dublicate values
Alternate approach to Jan's using features of categorical arrays (which the IDs logically are) % some dummy data of the same ty...

4年以上 前 | 0

| 採用済み

回答済み
I have a function (ex. adaptive) in a for loop which has two arrays as output. I want to save all the outputs in a single matrix. it can just save the last vector
You have to index the out arrays on the LHS of the assignment or MATLAB will, as you've observed, overwrite the whole variable o...

4年以上 前 | 0

| 採用済み

回答済み
How can I index a duration variable
Always much easier if you attach the actual code you've used to get to this point and a little bit, at least of the data array. ...

4年以上 前 | 0

| 採用済み

回答済み
How do I pull out from a table, the total mean of one item based on a particular condition (for several subjects), and then compute the difference in mean values?
tMEANS=rowfun(@mean,tData,'GroupingVariables'{'ConditionZ'},'InputVariables','ItemA','OutputVariableNames','GroupedMeans'); See...

4年以上 前 | 0

回答済み
Help creating loop that converts text to numbers
>> A='Now is the time...'; >> format short >> disp(double(A)) 78 111 119 32 105 115 32 116 104 101 ...

4年以上 前 | 0

回答済み
Removing quotations from table display
It's more a sanity check for the user to make sure their values are correct for what they expect. And there's where the purpose...

4年以上 前 | 0

回答済み
fwrite ascii output error
I see no such thing... >> fid=fopen('test2.dat'); fread(fid,'*int16') fid=fclose(fid); ans = 2×1 int16 column vector ...

4年以上 前 | 0

回答済み
How to reform cell into a vector of strings and text
Two of many ways to deal with the cellstr -- As string array >> S=string(split(C,',')); S=S(S~="") S = 6×1 string array ...

4年以上 前 | 0

回答済み
How do I swap 2 rows of a cell array?
One way... >> C=num2cell(randi(10,3,2)) C = 3×2 cell array {[5]} {[1]} {[9]} {[5]} {[6]} {[5]} >> ...

4年以上 前 | 0

| 採用済み

回答済み
how to find the nearest value?
The builtin way in MATLAB is interp1 >> A=[1:6]; >> B=flip(A)+0.1; >> posn=[10:10:60]; >> C=posn(interp1(B,A,A,'nearest','ex...

4年以上 前 | 0

回答済み
Problems with function num2str
Well, having a file helps (as always)... >> DatosInfo=ncinfo('..\Answers\DatosMarzoD1.nc') % see what's in the file... DatosIn...

4年以上 前 | 1

| 採用済み

回答済み
How to put endpoint on Bar graph
Like maybe? There's a klunky example at the doc for bar, but it is far simpler than the multi-step illustration to write it ...

4年以上 前 | 0

回答済み
How to calculate standar deviation and trend in each row of data
The input arguments for std include a flag for the weighting for the divisor and/or the option to compute a weighted standard de...

4年以上 前 | 0

回答済み
Multiple axes in a subplot
It's a pain -- MathWorks doesn't think you're supposed to ever want to do that; there are no builtin tools to do it. There may ...

4年以上 前 | 0

回答済み
how to plot each bin of data individually?
OK, here's another example; I'll add it as its own Answer -- carrying on from the above uBin=unique(tD.Bin); for i=uBin(:).' ...

4年以上 前 | 1

回答済み
Reshaping array with specific order
Can't be done with only reshape. You have only 10 elements in A and the requested output array requires 20. OTOH, it's easy en...

4年以上 前 | 0

さらに読み込む