Answered
Extrapolation: How do I extrapolate a curve with minimum error.
Here's what I put together. The extrapolation uses the 4-coefficient model returned by fit in your code: xx = 1:1000:40000; y...

3 years ago | 0

Answered
Organizing array of data skipping empty values
I don't think you need nested for-loops. Use the 1st column of the data read as an index into the M.Rexxxx structure to direct ...

3 years ago | 0

| accepted

Answered
How to assign corresponding Z value to gridded X,Y data ?
Try replacing interp2 with griddata, like this: [X,Y] = meshgrid(min(lla(:,1)):0.1:max(lla(:,1)), min(lla(:,2)):0.1:max(lla(:,2...

3 years ago | 1

| accepted

Answered
Use latex with bar command in categorical array
This should work: set(gca,'xtick',x,'XTickLabel',s,'TickLabelInterpreter','latex'); Above, x contains the tick values and s is...

3 years ago | 0

| accepted

Answered
Read specific column from dat file
No need to use textscan. Just use readmatrix: f = 'https://www.mathworks.com/matlabcentral/answers/uploaded_files/676208/trial...

3 years ago | 0

| accepted

Answered
Bar Graph legend & x axis
Change line 3 from t = datetime; to t = linspace(datetime('yesterday'), datetime('tomorrow'), length(InspectionPlan)); For p...

3 years ago | 1

| accepted

Answered
Sketch the graph using matlab
I think this is what you are looking for. NOTE: My script is based on code in Find Tangent Plane to Surface which you should re...

3 years ago | 0

| accepted

Answered
Align text of different entries in legend
A simple solution is to use a sans serif font, such as courier, and pad with spaces: % test data d = rand(3,5); bar(d'); l...

3 years ago | 0

| accepted

Answered
Reading values across an array
The position of each element in an array is the element's index. The element can be retrieved for operations, such as relationa...

3 years ago | 0

| accepted

Answered
arrange columns side by side using matlab
n = 5000; % number of files to read basefilename = 'temp'; % change as necessary M = []; % preallocate if you know the numbe...

3 years ago | 0

Answered
Find matrix (meshgrid) indices near plotted vector (points)
If by symmetry you mean fewer points but closer to the line, then reduce the number of query points, or points in the line: xva...

3 years ago | 1

| accepted

Answered
Reverting the caxis index
To reverse the order of colors, just change colormap(myColorMap); to colormap(flipud(myColorMap));

3 years ago | 0

Answered
Sort columns in a matrix with respect to the means of each column
Here's one way to do this: M = [1 6 2; 1 2 3; 2 7 5; 2 8 4] [~, idx] = sort(mean(M)); M(:,idx) = M Output...

3 years ago | 0

Answered
How do I specify a specific color for a specific value for velocity in seismic velocity modelling?
I think this is more or less what you are after. The code includes an example of adding text and a rectangle. You can customiz...

3 years ago | 0

| accepted

Answered
readtable reading string columns as matrix when lots of empty rows.
You ask: Is there a way to set specific columns to be read as cells? Yes, you can do this: opts = detectImportOptions('filenn...

3 years ago | 0

| accepted

Answered
how to add 4D matrix in row
OK, then... D = cat(4, A, B, C)

3 years ago | 0

Answered
Connecting plots of time series from a matrix data set?
I assume you're expecting a lot of clutter, since you are plotting 48 points for each of 62 days. Just use plot(SS48h) Here's...

3 years ago | 0

| accepted

Answered
How to plot two bar plot in the same figure?
There are a few ways to do this. The best option in any situation depends on how your data are organized (or can be organized) ...

3 years ago | 1

| accepted

Answered
I want to know how I can apply filter to my signal which I have plotted from a graph
Here's a simple approach to ploting the wave with some filtering added: f = 'https://www.mathworks.com/matlabcentral/answers/up...

3 years ago | 0

Answered
Write points at x axis Ploteditor
If you want text labels with greek symbols, set the x ticks and x tick labels for the axis. Here's the general idea: x = 0:0.5...

3 years ago | 0

| accepted

Answered
How to get a line plot without markers, on a logarithmic scale in a for loop?
As noted clearly by @dpb, you need to not use the 'o-' syntax to get the lines without markers: i = 1:10; alpha = rand(1,10); ...

3 years ago | 1

Answered
How to find the point of interception between the two lines?
I think this is more or less what your are looking for. The crossover indices are idx1 and idx2. Just for fun, and since you m...

3 years ago | 2

| accepted

Answered
How to Write a matlab code to plot the amplitude modulated signal in time domain.
Here's one way to do this. I'm showing two graphs, one with 5 Hz amplitude modulation, one with 5 kHz amplitude modulation. I'...

3 years ago | 1

| accepted

Answered
Converting String Column Data to Number
No need to use textscan. Just read the data into a MATLAB table. The 2nd column (TIME) will be treated as durations. You can ...

3 years ago | 0

Answered
Axis ticks alternating between appearing on either side of the plot.
I think this achieves what you are after (although I concur with @DGM that it may not fully resolve the issue you note): % test...

3 years ago | 0

| accepted

Answered
I keep receiving "Error using / Arguments must be numeric, char, or logical." when I try to find value of sym function
If a function calls another function that takes input variables, you need to define the function to pass the variables through t...

3 years ago | 1

| accepted

Answered
Renaming Fit rsquare value
ft1=fittype('m*x+b'); [Fit1,gof]=fit(A',T',ft1) R1 = gof.rsquare

3 years ago | 0

| accepted

Answered
Re-sizing matrixes extracted from NetCFD files
I think you can leverage the image stretching function imresize to your application. The destination matrix can be any size and...

3 years ago | 0

| accepted

Answered
in each iteration I want to get the sum of all elements except of the i element
for i = 1:length(a) s = sum(a)-a(i) end

3 years ago | 0

| accepted

Load more