Réponse apportée
How to calculate the time interval and the mean of values in a row?
Put your data in a timetable, TT, then do the following: %% Interpolate data every minute TT2 = retime(TT,'minutely','li...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
scatter plot with narrowed color range
Here's a colorbar for you to give you an idea of how you can build your own. The colorscale is not very intuitive. part1 = ...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
Heatmap on World Map
Here's some code from an old script of mine. Here's where I got the shapefile ( <https://www.naturalearthdata.com/downloads/10m-...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
How to traverse table row based on sets
*Method 1 - grpstats* For the sake of simplicity, let's use only the first 5 columns in this example. %% Import data ...

plus de 7 ans il y a | 0

Réponse apportée
How to combine subplots so they share axes?
Here's an example using the tight_subplot function from FEX ax = tight_subplot(2,2,0,0.1,.1);hold on set(ax,'color','non...

plus de 7 ans il y a | 1

Réponse apportée
How can I plot a legend only for data points?
Your plot outputs multiple line handles. If that is not what you want, then you need to adjust the dimensions of *xdata* and *yd...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
Extract values from a cell based on dates
Here's another approach %% Dummy dataset Date = datetime('2000-01-01')+days(0:364); Date.Format = 'dd/MMM/yyyy'; ...

plus de 7 ans il y a | 2

| A accepté

Réponse apportée
Color Bar Classifying different time points
Try something like this, which is based on a previous <https://se.mathworks.com/matlabcentral/answers/414253-why-do-plotting-fun...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
How to import a text file into matlab
fid = fopen('t.txt'); out=textscan(fid,repmat('%f',[1,12]),'delimiter',{'\t',',','{','}'},'MultipleDelimsAsOne',1) fclos...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
I am trying to generate uniformly distributed points inside a hexagon of specific centre (other than the origin). Any help is most welcome, thank you.
Simply move the center of the polygon and the random points a distance [xc;yc] from the origin. Here is your adjusted code: ...

plus de 7 ans il y a | 1

Réponse apportée
how to mark 2D plot with shapes for long array?
Use the 'markerindices' argument, introduced in 2016b plot(x, y, 'markerindices', [1:10:lenght(x)]) puts markers on ever...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
Synchronize axes limits with direct relation
This is the best I could do. I could not find a way to execute the callback when updating the axes limits from the command windo...

plus de 7 ans il y a | 0

Réponse apportée
Index in position 1 is invalid. Array indices must be positive integers or logical values.
Here is something fishy. sigma = func2(t,x,sigma_x,func1(kc,t)) ... function sigma = func2(t,M,sigma_M,func1) If y...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
Add surface based on two vectors in 3D plot
It's not trivial to make a triangular surface from three points in space, at least not from the |mesh| function. I would probabl...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
Two vectors different from each other at least at two points
sum(abs(V1-V2)~=0)>=2 Will output 1 if they differ at two or more indices. You may want to set a tolerance if they are floa...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
single trendline for multiple series
Let's say you have single column arrays x1, x2, x3 and their corresponding y1, y2 ,y3. %% concatenate x = [x1;x2;x3];...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
I have a 9000x21 matrix where each 60x21 section represents a frame. how do I plot each frame sequentially to make an animated plot. This is what I have so far.
Here's something you can start from %% Some data A=rand(9000,21); figure; %% Config axes axes('view',[0 90]...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
problems with function "find". matlab doesn't match two numbere which are built equal
It is better to compare floats using a tolerance tol=0.01; M = find(abs(time-46.5)<tol); I was however able to find t...

plus de 7 ans il y a | 0

Réponse apportée
how to customize 2D plot lines with shapes?
The easiest way is to add it when you plot plot(x,y,'style') where 'style' is a combination of color, marker and linesty...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
Average data along z
mean(A,3)

plus de 7 ans il y a | 1

Réponse apportée
HI, i want to do this type of graphic, but i do not how and if it is possible.
ax(1)=subplot(3,1,1) plot(rand(10,10)) ax(2)=subplot(3,1,2) plot(rand(10,10)) ax(3)=subplot(3,1,3) plot(rand(10...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
change x,y,z axes position in a 3d plot graph
A bit late to the party, but there's a pretty neat undocumented feature that lets you control the position of the rulers in 2d a...

plus de 7 ans il y a | 3

Réponse apportée
Is it possible to use yticks only on one side?
The yticks appear on both sides due to the box being 'on', so to say. Remove them by box off This will of course also re...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
Autoarrange title and top xlabel on plot
Sure, omit the position argument when you create the secondary axes and then add this at the end of the script primary_axis...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
date to date month calculation coding
dt = caldiff([datetime(2018,1,1);datetime('today')]) dt = calendarDuration -9mo -4d and if you want to extra...

plus de 7 ans il y a | 0

Réponse apportée
regexp find next char
No real benefit in using regexp here strs = strsplit(A,'\') id = find(strcmp(strs,'A to B')==true) B = strs{id+1} ...

plus de 7 ans il y a | 0

Réponse apportée
In a 3d graph. Can we put limits on z axis w.r.t. x and y axis?
I made your code a bit faster and fixed your problem. %% Load data [num,txt,raw] = xlsread('Mappe2.xlsx') ; x = num(:...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
axes & subplot etc. return double instead of matlab.graphics.axis.Axes
Probably due to your pre-2014b MATLAB release <https://se.mathworks.com/help/matlab/graphics_transition/graphics-handles-are-...

plus de 7 ans il y a | 2

| A accepté

Réponse apportée
determining the greatest number
Read about the <https://se.mathworks.com/help/matlab/ref/max.html *max*> function You do not need to make a loop, and it is f...

plus de 7 ans il y a | 0

Réponse apportée
Mapping 3D velocity data onto a uniform grid
Try this [Xq,Yq,Zq] = meshgrid(min(x):0.001:max(x),min(y):0.001:max(y),min(z):0.001:max(z)); Uq = griddata(x,y,z,u,Xq,Yq...

plus de 7 ans il y a | 0

| A accepté

Charger plus