Answered
PLEASE I NEED YOUR ASSISTANCE
I am not exactly certain what you want. Try this — T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded...

5 years ago | 0

Answered
Empty sym: 0-by-1
Exploring the function is often worthwhile. It apparently has a real root at about -0.45, so share that information with vpasol...

5 years ago | 0

| accepted

Answered
How to recode the strings() function?
The string data type is new to R2016b. A possible workaround could be the cellstr function (introduced prior to R2006a). E...

5 years ago | 1

Answered
How to preserve apostrophe sign in a string in Matlab?
Enclose the apostrophes in apostrophes — x = 'La drôle de tête du râteau est posée contre le mûr près de l''''abîme'; sprintf...

5 years ago | 0

Answered
How do I plot 3d graph ?
Interpolate! N = 50; xv = linspace(min(x), max(x), N); yv = linspace(min(y),m max(y), N); [Xm,Ym] = ndgrid(xv, yv); Zm = ...

5 years ago | 0

Answered
Vectors -Must- be the same length
Change the for loop to: for it=2:itmax dSodt(it)=-r*S(it-1)*I(it-1); S(it)=S(it-1)+dSodt(it)*dt; dRodt(it)=a*I(...

5 years ago | 0

Answered
Transfer character string from sprintf to subtitle
To print a single ‘\’ using sprintf (and the others, like fprintf and compose), use a double backslant ‘\\’. So: i = 1; Q ...

5 years ago | 0

| accepted

Answered
How to approximate a staircase signal into a linear signal?
There are several options, the most obvious being lowpass filtering. One straightforward way to do that iws with the movmean ...

5 years ago | 0

Answered
How to find the time of the max peak in a signal?
The easiest way is to have findpeaks return the indices in the second output — t = ...; ...

5 years ago | 1

| accepted

Answered
Simple question, how can I plot this tan x function?
Perhaps — x = @(y) tan(y) figure fplot(x, [-pi pi]) grid xticks([-pi -pi/2 0 pi/2 pi]) set(gca, 'XTickLabel',{'$-\pi$',...

5 years ago | 1

| accepted

Answered
Finding x and y values from certain values of y = 0, x = 0, ymax and xmax from a plot
One option is to model it as described in how to find ascending and descending of hysteresis loop?, then use the model result to...

5 years ago | 0

| accepted

Answered
Synchronize sensor data from multiple sensors
If the first columns are not actulal times, as would otherwise be used with datetime or duration, just interpolate. Consideri...

5 years ago | 1

| accepted

Answered
Why is command window printing out all the code?
The echo function may have become activated somehow. See if: echo off solves it. .

5 years ago | 0

| accepted

Answered
Convert Nan to zero in fplot
To plot the first value as 0, the most effective and efficient way to do what you want is to add a very small value (such as eps...

5 years ago | 1

Answered
How to extract all rows that only one columns has a value greater than?
One approach — T1 = array2table(randi(60,15, 7)) idx = any(T1{:,:}>50,2); % Logical Row ...

5 years ago | 0

| accepted

Answered
contourf doesn't plot left side of the figure in log scale!
The problem is the resolution in the ‘force’ vector. For example, check the increments — format long f1 = mean(diff(linspa...

5 years ago | 1

| accepted

Answered
PLotting a graph of third order differential equation
The initial conditions are not provided, and it is not possible to plot a function with symbolic (or otherwise undefined) parame...

5 years ago | 1

| accepted

Answered
How to change the direction of x axis.
Reversing the axis direction reverses the plot as well. I = imread('https://www.mathworks.com/matlabcentral/answers/uploaded_...

5 years ago | 1

| accepted

Answered
How can I plot a 2D graph with the Z value in color?
Try this — x = linspace(0,1); y = 2*(0:2)'+sin((1:3)'*2*pi*x); y(3,end) = NaN; figure plot(x, y(1:2,:)) hold on patch(...

5 years ago | 1

Answered
How can I plot out the derivatives here?
Either plot the differential equation using the solved values for ‘t’, and the solved values for the integrated variables, and o...

5 years ago | 0

Answered
Linear Regression gives NaN
There are 8 NaN values in those variables. Eliminate them and it works — T1 = readtable('https://www.mathworks.com/matlabce...

5 years ago | 0

| accepted

Answered
where could my error
I bellieve ‘NumSamples’ should be larger. Try this — Fs = 5000; % <- A...

5 years ago | 1

Answered
How to shorten the amount of decimals?
Use the digits function.

5 years ago | 0

| accepted

Answered
How do find the peaks of pulses from an array
It would be helpful to have a sample of the data. Two options: findpeaks and islocalmax.

5 years ago | 0

| accepted

Answered
How do I plot this as a unit step response
If you just want to plot it, the eassiest way is first to code it correctly, then use fplot. syms t C(t) = 0.5*(1 - exp(-2*...

5 years ago | 0

| accepted

Answered
30-day running running mean to the detrended timeseries
This requires reading it as a table, converting it to a timetable and then use the retime function — T1 = readtable('https://w...

5 years ago | 0

| accepted

Answered
Modelling of prediction equation
Yes. Combine the first three variables into a single matrix, then rever to them by columns. The procedure would go somethi...

5 years ago | 1

Answered
Importing table and making a stacked plot with same x and y axis
There are some non-finite values in ‘tbl3’ that made this interesting. This approach interpolates all the data in the three t...

5 years ago | 1

| accepted

Answered
Help! Graph shows nothing when I run my system of differential equations code.
The plot call is in the wrong place in the code. It should be after the ode45 call. The good news is that it’s growing like...

5 years ago | 1

| accepted

Answered
How do I get the x y coordinates from an index?
My best guess as to what you want — A =[0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9]; index = 4; [r,c] = ind2sub(siz...

5 years ago | 1

| accepted

Load more