已回答
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...

6 years 前 | 0

| 已接受

已回答
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 = ...

6 years 前 | 0

| 已接受

已回答
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-...

6 years 前 | 0

| 已接受

已回答
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 ...

6 years 前 | 0

已回答
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...

6 years 前 | 1

已回答
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...

6 years 前 | 0

| 已接受

已回答
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'; ...

6 years 前 | 2

| 已接受

已回答
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...

6 years 前 | 0

| 已接受

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

6 years 前 | 1

| 已接受

已回答
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: ...

6 years 前 | 1

已回答
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...

6 years 前 | 0

| 已接受

已回答
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...

6 years 前 | 0

已回答
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...

6 years 前 | 1

| 已接受

已回答
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...

6 years 前 | 0

| 已接受

已回答
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...

6 years 前 | 0

| 已接受

已回答
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];...

6 years 前 | 0

| 已接受

已回答
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]...

6 years 前 | 0

| 已接受

已回答
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...

6 years 前 | 0

已回答
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...

6 years 前 | 1

| 已接受

已回答
Average data along z
mean(A,3)

6 years 前 | 1

已回答
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...

6 years 前 | 1

| 已接受

已回答
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...

6 years 前 | 3

已回答
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...

6 years 前 | 0

| 已接受

已回答
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...

6 years 前 | 0

| 已接受

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

6 years 前 | 0

已回答
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} ...

6 years 前 | 0

已回答
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(:...

6 years 前 | 0

| 已接受

已回答
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-...

6 years 前 | 2

| 已接受

已回答
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...

6 years 前 | 0

已回答
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...

6 years 前 | 0

| 已接受

加载更多