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

alrededor de 7 años hace | 0

| aceptada

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

alrededor de 7 años hace | 0

| aceptada

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

alrededor de 7 años hace | 0

| aceptada

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

alrededor de 7 años hace | 0

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

alrededor de 7 años hace | 1

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

alrededor de 7 años hace | 0

| aceptada

Respondida
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'; ...

alrededor de 7 años hace | 2

| aceptada

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

alrededor de 7 años hace | 0

| aceptada

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

alrededor de 7 años hace | 1

| aceptada

Respondida
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: ...

alrededor de 7 años hace | 1

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

alrededor de 7 años hace | 0

| aceptada

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

alrededor de 7 años hace | 0

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

alrededor de 7 años hace | 1

| aceptada

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

alrededor de 7 años hace | 0

| aceptada

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

alrededor de 7 años hace | 0

| aceptada

Respondida
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];...

alrededor de 7 años hace | 0

| aceptada

Respondida
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]...

alrededor de 7 años hace | 0

| aceptada

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

alrededor de 7 años hace | 0

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

alrededor de 7 años hace | 1

| aceptada

Respondida
Average data along z
mean(A,3)

alrededor de 7 años hace | 1

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

alrededor de 7 años hace | 1

| aceptada

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

alrededor de 7 años hace | 3

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

alrededor de 7 años hace | 0

| aceptada

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

alrededor de 7 años hace | 0

| aceptada

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

alrededor de 7 años hace | 0

Respondida
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} ...

alrededor de 7 años hace | 0

Respondida
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(:...

alrededor de 7 años hace | 0

| aceptada

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

alrededor de 7 años hace | 2

| aceptada

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

alrededor de 7 años hace | 0

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

alrededor de 7 años hace | 0

| aceptada

Cargar más