Réponse apportée
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...

plus de 7 ans il y a | 0

Réponse apportée
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...

plus de 7 ans il y a | 0

Réponse apportée
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...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
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/...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
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.

plus de 7 ans il y a | 0

Réponse apportée
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 ...

plus de 7 ans il y a | 0

Réponse apportée
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...

plus de 7 ans il y a | 1

Réponse apportée
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...

plus de 7 ans il y a | 0

Réponse apportée
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...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 7 ans il y a | 0

Réponse apportée
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=...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
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(...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
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. ...

plus de 7 ans il y a | 0

Réponse apportée
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. ...

plus de 7 ans il y a | 0

Réponse apportée
"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}=...

plus de 7 ans il y a | 0

| A accepté

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

plus de 7 ans il y a | 0

Réponse apportée
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...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
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 = ...

plus de 7 ans il y a | 2

| A accepté

Réponse apportée
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 ...

plus de 7 ans il y a | 1

Réponse apportée
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...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 7 ans il y a | 2

| A accepté

Réponse apportée
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(...

plus de 7 ans il y a | 0

| A accepté

Charger plus