Answered
How to break ylabels of automatically created scatter plots in several lines?
Like this? ylabelname=sprintf('%s_{%s} (%s)',A.Name(row),A.Var(row),A.Unit(row)) ylabel(ylabelname,...) You can also ...

7 years ago | 0

| accepted

Answered
Randomly assign elements of one vector into different vectors?
Just shuffle your vector and then split it v=v(randperm(length(v))) V = mat2cell(v,1,[4 3 5 5 3])

7 years ago | 2

| accepted

Answered
Can you set a plot property as an equation?
You can use the *text* function instead, where the position is linked to the axis. Also, the syntax here is wrong set(h...

7 years ago | 0

| accepted

Answered
how can i rotate a figure without using the figure window but using code
You can change the 'view' to rotate, for example set(gca,'view',[90 90]) You can then work with the 'xlim' and 'ylim' to...

7 years ago | 1

| accepted

Answered
how to read selected data from text file matlab ?
|readtable| can do this for you easily. %%Read the relevant columns, exclude 10 rows opts=detectImportOptions('str.txt'...

7 years ago | 0

| accepted

Answered
using export_fig to crop image, including axis
Consider removing the ticklabels and/or ticks before exporting the figure. set(gca,'ytick',[],'xtick',[]) set(gca,'ytick...

7 years ago | 0

| accepted

Answered
How can i print z axis values on a pcolor plot
Something like this? [X,Y]=meshgrid(x,y); hold on; pcolor(x, y,z); colormap summer; colorbar text(X(:),Y(:)...

7 years ago | 0

| accepted

Answered
I want to animate this function through time
read here <https://www.mathworks.com/help/matlab/creating_plots/animation-techniques-1.html> I would rather update the |xd...

7 years ago | 0

Answered
how to draw the intersection of two graphs
Try <https://se.mathworks.com/matlabcentral/fileexchange/22441-curve-intersections?focused=5165138&tab=function InterX> from fil...

7 years ago | 0

Answered
create a time table from specific time date format
The format is not an issue but there are several ways to import. Here is one: opts = detectImportOptions('data.txt'); o...

7 years ago | 0

| accepted

Answered
What is the correct handle for a scatter plot with 2 y-axes?
The axes handles are stored in ax(1) and ax(2) and the plots are stored in p1 and p2. Use ax to set limits, labels, ticks and an...

7 years ago | 1

| accepted

Answered
How can I put my plot behind the legend (GUI)
if |h| is the handle to your legend, i.e. h=legend('location','northeast') then change the backgroundcolor by: set(...

7 years ago | 1

Answered
Time Series with unique column values
Something like this data=readtable('sample09.csv') [G nms]=findgroups(data(:,1)); t = datetime(data{:,2},'InputF...

7 years ago | 0

Answered
Arranging corresponding elements of rows in a cell.
Thsi code got ugly quick. Anyway, here's something I stitched together. I'm not sure if it will work when there is nothing detec...

7 years ago | 0

| accepted

Answered
How to extract single x-value given y threshold
I always recommend <https://se.mathworks.com/matlabcentral/fileexchange/22441-curve-intersections?focused=5165138&tab=function I...

7 years ago | 0

| accepted

Answered
Common X label for 2x2 subplots without using for loop?
Here is how you can set a single centered x- and y-label on a 2x2 plot. h1=subplot(2,2,1); h2=subplot(2,2,2); h3=subplot(2,2,...

7 years ago | 4

| accepted

Answered
how to read a txt file having alphanumeric data and special characters. ? My text file is like this. I tried textread but could not get a result. any suggestion.
str=fileread('notes.txt'); str=regexprep(str,'[:+*a-zA-Z]',' ') opt = {'Delimiter',' ','MultipleDelimsAsOne',true,'Colle...

7 years ago | 2

Answered
Interpolate time series data for the same time period on each day
Here's one way to do it. %%Original timetable, 5 minute intervals t=[datetime('1990-1-1 00:00'):minutes(5):datetime(...

7 years ago | 0

| accepted

Answered
How to consolidate a vector of time stamps and perform interpolation to calculate the missing items?
Your first problem is a non-issue. Just read your times like this A = datetime(A,'format','MM/dd/yyyy hh:mm:ss aa') A =...

7 years ago | 0

| accepted

Answered
Remove column in cell data
Try this B=cellfun(@(x) sum(sum(abs(x)>1)),C(2,:),'uniformoutput',false) B=cell2mat(B); C(:,B<1)=[] C = 3×2 c...

7 years ago | 0

| accepted

Answered
Converting from grayscale to binary image gives error
The threshold (0.4) is too high. Reduce the threshold (to e.g. 0.2) or use |imbinarize| instead of |im2bw| (recommended).

7 years ago | 0

| accepted

Answered
How do I change the labels values under contour plot (CONTOUR and CLABEL)?
Turns out if you do *not* pass the contour handle to |clabel|, then |clabel| outputs the labels, which you can easily change. If...

7 years ago | 2

| accepted

Answered
How to manually change plot x-axis to months
You need to pass a cell array to |xticklabels| instead of a string. You build a cell array with {} instead of []. For example ...

7 years ago | 1

| accepted

Answered
How can I create a plot like this?
Kind of looks like a scatter plot. You can try this: %%Load data data = load('Tc1.mat'); Tc1=data.Tc1; t=Tc1.t ...

7 years ago | 0

| accepted

Answered
keep just positive or just negetive answer of acos?
If A is a vector with your answers. Remove non-negatives by A(A>=0)=[]

7 years ago | 0

| accepted

Answered
Legend Positioning in figure w/Subplots
You want to add legend without the axes size being reduced? Easy, just add the legend inside the axes, e.g. *southwest*, as this...

7 years ago | 2

Answered
Generate Plot Based on Interval Data
the <https://se.mathworks.com/help/matlab/ref/stairs.html stairs> function will do it for you. Here is something you can start w...

7 years ago | 1

| accepted

Answered
Why do plotting functions like bar or barh take a long time to execute?
I would guess that |barh| is slow because it creates 600 different patch objects, each with a different handle. Try this solutio...

7 years ago | 0

| accepted

Answered
Matlab dont read an excel column
|xlsread| has four outputs, because you cannot mix numbers and text in the same array. I am _guessing_ that there is text in the...

7 years ago | 0

Answered
How can I store number and string in the same cell in UITable?
Not if you want the number stored as a double. See this recent thread: <https://se.mathworks.com/matlabcentral/answers/414176...

7 years ago | 0

| accepted

Load more