Answered
How to get 10000 variable numbers between the range of 0 and 100?
If you want the numers to be between and , use the logspace function, then use randperm to randomise them — varx = logspace(...

4 years ago | 0

| accepted

Answered
How to plot dotted line drawings with imaginary number data?
I am not certain either, since I have no idea what the data mean, Here are two possible apporoaches — M = [1 69 -0.22438-0....

4 years ago | 0

| accepted

Answered
How to "automatically" show an equation, written in the matlab editor, as a text on a plot
I apologise for the delay. Re-posting — syms x % x = 1 : 10 ; a = 0.5 ; y = exp(-a*x); % equation to show inside the plo...

4 years ago | 1

| accepted

Answered
2d extrapolation to replace NaN in corners
The fillmissing function may do what you want. Try something like this — M = NaN(5); M([3 (7:9) 11:15 (7:9)+10 23]) = ra...

4 years ago | 1

Answered
How can i calculate the length of curve?
Possibly — X=[96.0741000000000,97.1940000000000,98.3139000000000,99.4338000000000,100.553700000000,101.673600000000,102.793500...

4 years ago | 1

Answered
Accessing alternate rows and columns in the matrix.
Try this — A = [ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15...

4 years ago | 0

| accepted

Answered
Extract specific X & Y data from Contour curve
Try this — %% Input Parameters for Earth Ctheta = 5; Cphi = 0.001; phimax = deg2rad(58); thetamax...

4 years ago | 0

| accepted

Answered
Can't assign VariableUnits to TimeTable
For some reason, it doesn’t like 'VariableUnits' as part of the initial timetable declaration. This alternative approach wor...

4 years ago | 0

| accepted

Answered
Adding values to a cell array in a loop for wav files
Save it to a cell array instead — peaks{i} = [pks freq] That should work, since the two vectors being cncatenated will have t...

4 years ago | 0

Answered
Matlab forgets userpath setting after crash
‘Can it be fixed?’ Probably. Use a startup file. Create it and then put it in the main ...\Documents\MATLAB directory.

4 years ago | 0

Answered
How to plot using STACKEDPLOT in MATLAB
The core MATLAB version of stackedplot was introduced in R2018b. The posted plot image seems to be more like a waterfall or rib...

4 years ago | 0

Answered
Displaying exponential notation with num2str?
I wrote a little utility program to do that sort of thing a few years ago. Try this — Q1 = [-pi*1000; 0; pi*100]; expstr =...

4 years ago | 1

| accepted

Answered
Matlab read .csv file together with headlines and operations on matrix elements?
The readtable function call may be in error if you want to import the variable names, however I don’t know from the code what yo...

4 years ago | 0

| accepted

Answered
Scatter multiple table rows above same X-axis value
Try this — M = [1859 25.7 25.4; 1860 25.7 23.6; 1861 24.9 26.3]; figure scatter(M(:,1), M(:,[2 3]), 'filled') grid xlim(...

4 years ago | 0

Answered
Patch error when I plot x,y,z
Make them different colours and specify a view angle and it works — LD = load(websave('hex_3d','https://www.mathworks.com/matl...

4 years ago | 0

| accepted

Answered
How can I find order (or size) of a defined matrix (2D Array)?
Try this A=[ 1 2 3; 4 5 6; 7 8 9]; szA = size(A) .

4 years ago | 0

| accepted

Answered
How to plot a matrix that varies with theta?
Use the hold function to plot them all on the same axes, and use a marker to plot individual points. (The plot function plots l...

4 years ago | 1

| accepted

Answered
curve fit gaussian CDF
Consider using normcdf with mle or fitnlm. Try this — y = [ 0.0010 0 0.0020 0.0060 0.0210 0.0400 ...

4 years ago | 1

| accepted

Answered
how get date fromthe long number?
D = 1246573330; DT1 = datetime(D, 'ConvertFrom','datenum') DT2 = datetime(D, 'ConvertFrom','excel') DT3 = datetime(D, 'Conv...

4 years ago | 2

| accepted

Answered
How to transpose many matrices X_1 ... X_N at once?
Try something like this — X1 = randi(9,3) X2 = randi(9,3) X3 = randi(9,3) Xcat = cat(3,X1,X2,X3); Ycat = permute(Xcat,[2...

4 years ago | 2

Answered
How to add apostrophe as a text in a char of date?
I am not certain what result you want. Try this — DATE = '2019-05-31'; A2 = ['TO_DATE(''',DATE,''', ''YYYY-MM-DD'') '] No...

4 years ago | 0

| accepted

Answered
Tilted (inclined) circle in 3D
I usually use the rotate function for these problems. It’s just esaier. Try this — r = 1; xm = 0; ym = 0; teta = linspace...

4 years ago | 0

| accepted

Answered
I want to plot a complex function f(z) in 3D
I’m not certain what you want. Try this — t = linspace(0, 10); f = @(z) conj(z)./z; z = exp(1j*2*pi*t/max(t)); figure ...

4 years ago | 0

| accepted

Answered
Why the figure of the phase discontinuous?
The phase is likely wrapped. Use the unwrap function to provide a continuous phase. It may be necessary to experiment with i...

4 years ago | 0

| accepted

Answered
How to assign legend and marker to a 2D graph in Matlab?
T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1103385/sample.csv') % T1.Properties.VariableN...

4 years ago | 0

| accepted

Answered
Why is matlab showing the wrong answer?
The limits are reversed in the int call. syms x y t yint = t^2-(1/t)*y*(t/57) int(yint, t, 0, 57*x) .

4 years ago | 1

Answered
I want to convert one time format into another type
Another approach — dt1 = '16-Aug-0022 04:39:55 PM'; dt2 = datetime(dt1, 'InputFormat','dd-MMM-00yy hh:mm:ss a', 'Format','MM/...

4 years ago | 1

Answered
How do I modify my x data to be a specific length?
I am not certain what you want. Try this — x = [326,406,406,449,491,491,1353,1353,2379,2379]; y = [3.46,3.48,3.48,3.48,3.4...

4 years ago | 0

| accepted

Answered
Plotting a function with for loop
Subscript ‘G’ to save it as a vector — a=100.400; b=230.033; c1=1; c2=4; k=1:100; for i =1:1:100 G(i)=1+c1*exp(-j*i*...

4 years ago | 0

Answered
Doing Fourier transform (FFT) of the output of an ode45 solution and subsequent plotting in the frequency domain.
The fft function requires that the time domain signal be samoled at regular intervals. The numerical dddifferential equation in...

4 years ago | 2

| accepted

Load more