回答済み
combine between numbers and characters in one vector
You cannot mix actual numbers and strings in the same array, but you could store the numbers as strings, or use another identifi...

8年弱 前 | 0

回答済み
Plotting a box plot and a time series on the same graph ? as a distribution over time. boxplot(reshape(fluxO2tom01and23,4,[])); and plot(o_optode_mean1,1:196)
Not sure if this is the complete answer, but you can vary the position of the boxes by the 'position' argument. |datetime| forma...

8年弱 前 | 0

回答済み
How to write a for-loop to calculate the sum of the integers from 11 to 45?
A for loop is one of the most basic (and overused) features, so it is worth to read up on it ( <https://se.mathworks.com/help/ma...

8年弱 前 | 0

| 採用済み

回答済み
plot certain values in yaxis
1e-6:1e-2:1e-14 ans = 1.0000e-06 There are two reasons why this does not make any sense. * The step size is la...

8年弱 前 | 1

| 採用済み

回答済み
I have an image which is full black background and the image contain few of white point. How can i draw a straight line that connected most of the white point as shown in figure.
To avoid confusion, this answer is based on correspondence that has since been deleted. Original poster is looking for a type of...

8年弱 前 | 0

| 採用済み

回答済み
How can I get subscript instead in indices from sort() ??
|ind2sub| accepts multiple indices as input. It's right there in the first example of the <https://se.mathworks.com/help/matlab/...

8年弱 前 | 0

| 採用済み

回答済み
How do I change the line width in a contourslice plot?
Yes it does. |Contourslice| builds a number of patch objects, which have linewidths like any patch objects. If it really does no...

8年弱 前 | 0

| 採用済み

回答済み
Is there a way to plot a contour with a 3-Dimensional matrix?
You would probably be interested in using a <https://se.mathworks.com/help/matlab/ref/contourslice.html contourslice> plot.

8年弱 前 | 0

回答済み
Find minimum and maximum of a two variable function on fixed interval
Just take the max/min over the desired dimension. For example: max(U,[],1) %max row-wise max(U,[],2) %max column-wise ...

8年弱 前 | 0

回答済み
How can I change the position of the numbers in colorbar?
Rotating the ticklabels are surprisingly difficult. Ticklabels can not be rotated, but they can be replaced by normal text which...

8年弱 前 | 1

回答済み
How do I plot the minimum and maximum temperatures for each depth? i.e. the min and max boundaries of this graph?
Assuming you have |n| series of T(d), each with data on |m| depths, just concatenate all your data in a |m| x |n| matrix and plo...

8年弱 前 | 0

回答済み
How to display coordinates of points in "contourf"?
It's going to look real messy when you have high resolution x and y data. %% Some data [x,y,z]=peaks(20); [~,c]=cont...

8年弱 前 | 1

| 採用済み

回答済み
how do I plot input / output data so as to have a continuous bar in that range and not two simple points for each output / input?
From what you've described so far, a bar graph does not seem optimal. What about this approach instead? in=load('closing_op...

8年弱 前 | 0

| 採用済み

回答済み
Matlab's contour and colormap ignores input values
You can increase the resolution by adjusting the *levelstep* property contourf(x,y,z,'levelstep',2) Adjust the limits on...

8年弱 前 | 0

回答済み
Getting the values from the curve fitted model
If you used |fit|: p=fit(...) %your model y=p(x) %evaluate your model at x Similarily, if you used |polyfit|: p=...

8年弱 前 | 0

| 採用済み

回答済み
How to Use Character String as a For Loop Variable.
The condition must output a logical. Use e.g. |isequal| or == if isequal(Spring_type,'Open') ... end or if S...

8年弱 前 | 1

| 採用済み

回答済み
Shaded Contour and Line Contour in one CONTOURF
Yea that's fairly easy. An example: A=peaks(100); B=peaks(75); [~,h1]=contourf(A,'linestyle','none');hold on [c,h2...

8年弱 前 | 0

| 採用済み

回答済み
How to draw 3D XYZ plot with a matrix?
I stitched this together using quiver3. Possibly a bit buggy. %%Start point coordinates A=[38 70 0; 42 70 2; 42 7...

8年弱 前 | 1

| 採用済み

回答済み
Why is the function "isequal" giving wrong answer when comparing string fields of two structure arrays?
Can't tell why |isequal| returns false in your code. However, you can easily fix it by adding some curly brackets: isequal(...

8年弱 前 | 0

| 採用済み

回答済み
restructure cell array from textscan
What about this solution? I've replaced one of the numbers in the first column with a string, just to make sure it works. ...

8年弱 前 | 0

回答済み
less than or equal and greater than of equal operations
There is no problem with your code. In fact, if you copy your code as written in the question, you get the following results. ...

8年弱 前 | 0

回答済み
"if it possible to only keep the value of the last two iterations"
Seems fairly trivial, just store the results in a 1x2 cell array. A=cell(1,2); for i=1:10 A{1}=A{2}; A{2}=...

8年弱 前 | 0

| 採用済み

回答済み
Intersection between line and function
Use <https://se.mathworks.com/matlabcentral/fileexchange/22441-curve-intersections InterX> from fileexchange for high accuracy e...

8年弱 前 | 0

回答済み
How to fit this data?
Looks more like a smoothing filter than a fitted equation. Perhaps a moving average. A moving average filter goes over your d...

8年弱 前 | 0

| 採用済み

回答済み
Saving figures as a single figure
Here's an official answer. It's very old (release 2010) but still works. <https://se.mathworks.com/matlabcentral/answers/92...

8年弱 前 | 0

| 採用済み

回答済み
How do I convert a decimal number to a time?
Alternatively, if you just want to display amount of hours and minutes. duration(hours(7.8),'format','hh:mm') ans = ...

8年弱 前 | 2

| 採用済み

回答済み
How to plot date and time on x axis and data on y axis using matlab?
The data import is all messy and you are trying to jam two cell arrays into the plot. Two options, either add the cell range of ...

8年弱 前 | 1

回答済み
Find maximum values related to index
Ideal job for |findgroups| and |splitapply|. |VAL| is the max value in each group, located at |id_l| (local group index). Fo...

8年弱 前 | 0

| 採用済み

回答済み
How to make code repeat itself every second (Trading Toolbox)
while true %Insert code here pause(1) end Bonus, if your code takes a long time to run and you want the sc...

8年弱 前 | 2

| 採用済み

回答済み
How to connect these components in the image to make the crack continuous?
Try this, it's quite robust. However, you may want to exclude 'outliers' before interpolating. %%Read image I=imread(...

8年弱 前 | 0

| 採用済み

さらに読み込む