Beantwortet
Time approximation in matlab
If the sampling interval was constant: SamplesPerHour = 1500/24 Otherwise, you could use the retime funciton with the interva...

fast 4 Jahre vor | 0

Beantwortet
Trying a overlapping but piecewise plot
The problem description leaves much to the imagination. If you want to offset them on the x-axis, this likely requires a loop. ...

fast 4 Jahre vor | 0

| akzeptiert

Beantwortet
Trying to change the y axis range in fplot
See if ylim will do what you want — syms s a b c d e f n10 = a + (b*s) + c*(s^2) + d*(s^3) + e*(s^4) + f*(s^5) n10_d1 = diff...

fast 4 Jahre vor | 1

| akzeptiert

Beantwortet
How to extract labels from a xlsx graph in matlab
It depends how you’re importing the Excel file. If you use readtable, the header line (assuming only one) will be ‘VN’ in: T...

fast 4 Jahre vor | 0

Beantwortet
How would I find the median RR interval in an ECG signal?
Perhaps this — Fs = 500; t = linspace(0, 100, 100*Fs)/Fs; EKG = randn(size(t)); [pks, locs] = findpeaks(EKG, 'MinPeakProm...

fast 4 Jahre vor | 1

Beantwortet
Why am I receiving three outputs for this lsim function?
You’re actually receiving four, one for each state. However if you create a system object out of the matrices first, you only...

fast 4 Jahre vor | 0

Beantwortet
How can I get x-y values for a given z coordinate from a 3d surface plot?
You can use the find function to get the index coordinates of the point (it may require creating a tolerance, since the value yo...

fast 4 Jahre vor | 0

Beantwortet
Interpolation from a table
The interp2 function is one option — eb = [0 0.25]; yb = [0.5; 0.75]; K0 = [1.0009 1.3767; 0.9948 1.5583]; Check = [N...

fast 4 Jahre vor | 0

Beantwortet
indexing through array in for loop
What function are you using to estimate the statistic? I don’t see any built-in MATLAB functions for it, although I may be loo...

fast 4 Jahre vor | 0

Beantwortet
Can i pass an array of n strings to a function that takes n strings as input?
The plot calls should probably be referencing ‘i’ instead of ‘n’ and if you have R2016b or later, you can use string arrays — ...

fast 4 Jahre vor | 0

Beantwortet
Error using patch not enough input arguments
The 'FaceColor' name-value pair is not necessary in patch calls. Just use the designated colour or RGB triplet as the third arg...

fast 4 Jahre vor | 0

| akzeptiert

Beantwortet
Differential equation unable to find a symbolic solution
The equation is nonlinear in , and dsolve will not solve nonlinear differential equations. Integrating it numerically gives —...

fast 4 Jahre vor | 0

| akzeptiert

Beantwortet
How to perform summation of the given equation?
The ‘dz’ may mean the function is an integrand — syms z H = sym(10); k(z)=(15/2)*(H-z)*(sin(30)); K = int(k, z, 0, 10) K ...

fast 4 Jahre vor | 0

| akzeptiert

Beantwortet
How can I produce a plot like the one in the picture using quadratic equation in MATLAB?
I have no idea what the picture demonstrates. Perhaps something like this — a = randn b = randn c = randn r = roots([a b...

fast 4 Jahre vor | 1

Beantwortet
Envelope function of a signal
Use the envelope function. t = linspace(0, 1, 1E+3); s = sin(2*pi*t*5) .* sin(2*pi*t*100); [senvu,senvl] = envelope(s, 10...

fast 4 Jahre vor | 0

| akzeptiert

Beantwortet
Variable "Flag" is not fully defined in some execution paths. Why?
Because there are conditional statements in the code, and not all of them set the ‘Flag’ variable. One way to avoid that is t...

fast 4 Jahre vor | 1

Beantwortet
Convert audioread file to obtain spl
Use the Audio Toolbox function splMeter.

fast 4 Jahre vor | 0

| akzeptiert

Beantwortet
Adding Non-Plotted Items to Figure Legend
Perhaps something like this — x = 1:20; y(1,:) = 0.5+randn(size(x))*0.1; y(2,:) = 0.5+randn(size(x))*0.1; figure plot(x,...

fast 4 Jahre vor | 0

Beantwortet
Hi. I am having issues with having my matlab get past the ifourier part of my code. It just continually runs and is stuck at that part. The bold is where my computer is stuck.
It seems to work here — m = 10; % kg k = 15; % N/m b = 8; syms x(t) Dx = diff(x,t); h_eqn = m*diff(x,t,2) + b*dif...

fast 4 Jahre vor | 0

Beantwortet
function answer is displayed twice
‘How do I get rid of the ans= part being displayed as well?’ Perhaps: calcMax; (added semicolon) .

fast 4 Jahre vor | 0

Beantwortet
title plot can't be shown + grid
The title and grid functions do not apply until the axes are created. Also, there are two ‘subplot(2,3,1)’ creations, the secon...

fast 4 Jahre vor | 0

| akzeptiert

Beantwortet
How to integrate using the for loop?
No loop necessary — LD = load(websave('V1','https://www.mathworks.com/matlabcentral/answers/uploaded_files/1172553/V1.mat')); ...

fast 4 Jahre vor | 0

Beantwortet
Errors in loops in Matlab
Perhaps you intended: k(t+1)=alpha*k(t)^(alpha-1)+(1-delta)*k(t)-c1(t); ↑ instea...

fast 4 Jahre vor | 0

Beantwortet
find Maximum values in intervals of time(each 2000 values)
It would help to have the data. Try something like this — u = randn(1, 24001); t = 1:numel(u); r = 2000; U = zeros(r,c...

fast 4 Jahre vor | 0

| akzeptiert

Beantwortet
Predict power consumption using linear regression
There are 89 days in the data, so the data ‘wrap’ to 24 hours. T1 = readtable('https://www.mathworks.com/matlabcentral/answer...

fast 4 Jahre vor | 0

| akzeptiert

Beantwortet
Using regular expressions to filter files
There appears to be only one comma (,) in each line, so perhaps the extractAfter function (introduced in R2016b) will work. C...

fast 4 Jahre vor | 0

| akzeptiert

Beantwortet
How do I change the direction of the numbers on my axis.
I’m not certain what you want, however something like this may do what you want — x = linspace(-1, 1, 10); y = (x+1).^2; f...

fast 4 Jahre vor | 2

Beantwortet
readmatrix command is not working.
The readtable function was introduced in R2013b, and the readmatrix funciton in R2019a. If you do not have readmatrix, see if...

fast 4 Jahre vor | 1

| akzeptiert

Beantwortet
How to derive and plot derive for a set of data with non linear x axis?
I have no idea what the data are. Calculationg the numerical derivative is straightforward with the gradient function — x =...

fast 4 Jahre vor | 0

Beantwortet
Extracting Data from a .fig File
This should do what you want — F = openfig(websave('Group10%20heating','https://www.mathworks.com/matlabcentral/answers/upload...

fast 4 Jahre vor | 0

Mehr laden