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

mehr als 7 Jahre vor | 0

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

mehr als 7 Jahre vor | 0

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

mehr als 7 Jahre vor | 0

| akzeptiert

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

mehr als 7 Jahre vor | 1

| akzeptiert

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

mehr als 7 Jahre vor | 0

| akzeptiert

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

mehr als 7 Jahre vor | 0

| akzeptiert

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

mehr als 7 Jahre vor | 0

| akzeptiert

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

mehr als 7 Jahre vor | 0

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

mehr als 7 Jahre vor | 0

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

mehr als 7 Jahre vor | 1

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

mehr als 7 Jahre vor | 0

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

mehr als 7 Jahre vor | 1

| akzeptiert

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

mehr als 7 Jahre vor | 0

| akzeptiert

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

mehr als 7 Jahre vor | 0

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

mehr als 7 Jahre vor | 0

| akzeptiert

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

mehr als 7 Jahre vor | 1

| akzeptiert

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

mehr als 7 Jahre vor | 0

| akzeptiert

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

mehr als 7 Jahre vor | 1

| akzeptiert

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

mehr als 7 Jahre vor | 0

| akzeptiert

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

mehr als 7 Jahre vor | 0

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

mehr als 7 Jahre vor | 0

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

mehr als 7 Jahre vor | 0

| akzeptiert

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

mehr als 7 Jahre vor | 0

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

mehr als 7 Jahre vor | 0

| akzeptiert

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

mehr als 7 Jahre vor | 0

| akzeptiert

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

mehr als 7 Jahre vor | 2

| akzeptiert

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

mehr als 7 Jahre vor | 1

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

mehr als 7 Jahre vor | 0

| akzeptiert

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

mehr als 7 Jahre vor | 2

| akzeptiert

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

mehr als 7 Jahre vor | 0

| akzeptiert

Mehr laden