Answered
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...

7 years ago | 0

Answered
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...

7 years ago | 0

Answered
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...

7 years ago | 0

| accepted

Answered
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...

7 years ago | 1

| accepted

Answered
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...

7 years ago | 0

| accepted

Answered
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/...

7 years ago | 0

| accepted

Answered
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...

7 years ago | 0

| accepted

Answered
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.

7 years ago | 0

Answered
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 ...

7 years ago | 0

Answered
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...

7 years ago | 1

Answered
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...

7 years ago | 0

Answered
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...

7 years ago | 1

| accepted

Answered
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...

7 years ago | 0

| accepted

Answered
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...

7 years ago | 0

Answered
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=...

7 years ago | 0

| accepted

Answered
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...

7 years ago | 1

| accepted

Answered
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...

7 years ago | 0

| accepted

Answered
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...

7 years ago | 1

| accepted

Answered
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(...

7 years ago | 0

| accepted

Answered
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. ...

7 years ago | 0

Answered
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. ...

7 years ago | 0

Answered
"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}=...

7 years ago | 0

| accepted

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

7 years ago | 0

Answered
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...

7 years ago | 0

| accepted

Answered
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...

7 years ago | 0

| accepted

Answered
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 = ...

7 years ago | 2

| accepted

Answered
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 ...

7 years ago | 1

Answered
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...

7 years ago | 0

| accepted

Answered
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...

7 years ago | 2

| accepted

Answered
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(...

7 years ago | 0

| accepted

Load more