Community Profile

photo

jonas


200 total contributions since 2018

Please do not send private requests per e-mail, as I wish for my contributions to reach a broader audience. If you specifically want help from me, feel free to grab my attention by sending an email with a link to your question.

Contact

jonas's Badges

  • Pro
  • Knowledgeable Level 4
  • 6 Month Streak
  • First Answer

View details...

Contributions in
View by

Answered
How can I save an axes which has multiple coordinate systems?
|Copyobj| doesn't seem to work with yyaxis because you end up with a single axes object having multiple coordinate systems. You ...

9 hours ago | 0

Answered
Hourly variation of wind for each month, using Quiver
This is my attempt with normalized/scaled arrows. See attachment. load Viento_DMC T=datetime(datevec(TIEMPO)); %...

10 hours ago | 0

| accepted

Answered
Axis Clipping not working in pdf print
I think I have finally figured it out. The issue is related to the |yyaxis right| command, which creates a 2nd yaxis with defaul...

3 days ago | 0

Answered
Skip big header from a txt file
fid = fopen('datam.txt'); C = textscan(fid,'%d%d%d%*[^\n]',... 'Delimiter',' ',... 'TreatAsEmpty','No',... ...

3 days ago | 0

| accepted

Answered
How do I convert date into day of the year?
You don't really need the hour of day. data=xlsread('Lat30.xlsx'); date=datetime(data(:,1:3)); d=day(date,'dayofyear'...

4 days ago | 2

| accepted

Answered
How to set colormap for a 3D surface that is projected onto the XY Plane?
In the answer to the other question: _"You can use a different colormap and a different method for calculating the Z-values, ...

4 days ago | 0

Answered
Aligning subplots (colorbar and axis equal issue)
This was more difficult than I'd imagined, as *axis equal* changes the 'tightinset' and 'aspectratio' of the plot. This fileexch...

4 days ago | 0

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

4 days 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])

5 days 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...

5 days 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...

5 days ago | 1

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

5 days 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...

5 days ago | 1

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

5 days 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(:)...

6 days 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...

6 days 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...

6 days 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...

6 days 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...

6 days 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(...

6 days 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...

6 days 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 days 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 days 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=sub...

7 days ago | 1

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

8 days 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).

8 days ago | 0

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

8 days ago | 0

| accepted

Load more