Answered
Averaging hourly time series data to daily time series
Try this — T1 = readtable('Chris Martin_2022_02_09.txt') T1.Var1 = datetime(T1.Var1, 'InputFormat','yyyy-MM-dd''T''HH:mm:ss''...

5 years ago | 0

| accepted

Answered
How to display FWHM in the graph
Try this — format longEng A = readmatrix('https://www.mathworks.com/matlabcentral/answers/uploaded_files/888835/test.txt') ...

5 years ago | 0

| accepted

Answered
Obtain value of a variable when y = 0 in a function
One option is to add a test for the value of ‘y’ as I did here. V0 = 420; b0 = 60; C = pi; u = 50; %Data inputs fprint...

5 years ago | 0

| accepted

Answered
Error graphing a VVF
The ‘z’ function needs to be defined as symbolic. Without that provision, fplot3 sees it as a double, not a symbolic constant (...

5 years ago | 0

| accepted

Answered
How do I add legends to my plot?
There are apparently two lines for every channel. There are two options: The first is to simply plot the first row rather tha...

5 years ago | 1

| accepted

Answered
Im trying to find the zeroes of the two lines on the graphs I've made
Another approach — n = 32; S = 23.45*sind(360*(284 + n)/365); phi = 38.9072; tsol = 0:1/60:24; w = 15*(tsol-12); Gsc = 13...

5 years ago | 1

| accepted

Answered
Plot function only plots one coordinate
MATLAB does not use C increment syntax. One approach would be to subscript them and plot them at the end. That is definitely...

5 years ago | 1

| accepted

Answered
how to make an image disappear?
In the documentation on Image Properties, see the Visible property. For the delay, see if the pause function will do what you...

5 years ago | 0

| accepted

Answered
How to set x-ticks and y-ticks for the Raman image?
Try this — T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/887625/Raman%20Intensity%20Ratio.xls...

5 years ago | 1

| accepted

Answered
Solving a set of differential equations for a packed bed reactor - chemical reaction engineering
I did not run the code, however the problem is likely that using ‘var’ as a variable name is overshadowing the var (variance) fu...

5 years ago | 0

| accepted

Answered
ODE45 change the value of a parameter at each time step
Try something like this — tspan = 0:0.1:1; values = [0.6 0.8 0.9 1.4 2.5 0.6 0.7 0.8 0.9 1 2.3]; beta = 0.1; x_0 = 0; x_0_...

5 years ago | 0

Answered
best fit curve using linear regression
Here is the stepwiselm result — T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/886775/Concre...

5 years ago | 0

| accepted

Answered
contour lines on the surface plot
Try something like this — [X,Y,Z] = peaks(50); % Example Surface figure surf(X,Y,Z,...

5 years ago | 1

| accepted

Answered
Color certain area of normal distribution
Try this — x = linspace(4, 7, 250)*1E4; y = @(x) normpdf(x,57565.67,1743.56); y1 = @(x) normpdf(x,54908.02,1663.82); xp =...

5 years ago | 0

| accepted

Answered
how to have step time in specific time
Use the lsimplot function. There is a specific example in Custom Plot of System Evolution from Initial Condition. It describ...

5 years ago | 0

Answered
How to find intersection between a straight line and a curve?
Another approach — x = linspace(-15, 15, 150); y = sinc(0.5*x); l = 0.6; [~,idx] = max(y); xq(1) = interp1(y(1:idx),x(1:...

5 years ago | 2

| accepted

Answered
Please give me some head start to find similar pattern on signal.
Two options that I would experiment with are findsignal and findchangepts to segment the signal. These are both in the Signal...

5 years ago | 1

Answered
How to Change Initial Number of Random Points in Genetic Algorithm?
Create an options structure using optimoptions, and define 'InitialPopulationMatrix' to the correct dimensions for your problem....

5 years ago | 0

| accepted

Answered
Optimization terminated: average change in the fitness value less than options.FunctionTolerance.
That is not an error. That is simply a message that explains the reason ga finished its optimisation. Did it produce an ac...

5 years ago | 1

| accepted

Answered
How to take a data form text file to put it in another file?
Try this — fidi = fopen('File.1.node','rt'); F1c = textscan(fidi, '%f%f%f%f', 'HeaderLines',1, 'CollectOutput',1); fclose(fi...

5 years ago | 0

| accepted

Answered
System Identification - input data file?
If the ‘u’ and ‘y’ data are in the time domain, use the iddata function to create a data object that the estimation functions (s...

5 years ago | 0

Answered
how i can find the stride time for each gait cycles
Use findpeaks or islocalmax to find and isolate the peaks that describe the stride. Use findpeaks on the negative of the sign...

5 years ago | 0

Answered
How to choice the right frequency analysis
I do not know what the experimental setup was, so I cannot suggest any particular cause as being the source of the spikes. They...

5 years ago | 0

| accepted

Answered
Error in using lsim function
The code does not define ‘u’ anywhere except in the ‘springmass’ function, and since functions have their own workspaces, and it...

5 years ago | 0

| accepted

Answered
Is it possible to create a tuner with matlab?
Try this: Notes = {'C4','C#4/Db4','D4','D#4/Eb4','E4','F4','F#4/Gb4','G4','G#4/Ab4','A4','A#4/Bb4','B4'}; Scale = [261.63; 27...

5 years ago | 0

| accepted

Answered
How do I plot a integration result?
The ‘Ps’ integration produceds onlly one value, the value of the integral between the limits of integration. To get a vector f...

5 years ago | 1

| accepted

Answered
How do I juxtapose the two plots so that the circles indicating the peak amplitude is in contrast with the plot?
Try this — plot(t(locs),pks,'o'); The reason is that with this findpeaks call: [pks,locs] = findpeaks(Ca) The ‘locs’ outpu...

5 years ago | 0

| accepted

Answered
I am having trouble doing integration for the following code.
The warning is likely the result of the second term, that becomes Inf at higher values. Fs= 2.16*10^-5*pi; % Geometri...

5 years ago | 0

| accepted

Answered
Error in loglog plot
I have no idea what the original problem was, however breaking it out into two different plot statements (that I originally did ...

5 years ago | 0

| accepted

Answered
what is the meaning of set(gca,'Fontsize',16)
The gca function returns the handle to the current axes object. The set call sets the 'FontSize' of the associated text objects...

5 years ago | 0

Load more