回答済み
legend bar not visible
This is a problem with recent versions of AMD video drivers. The generally-accepted solution is: opengl('software') and if...

11日 前 | 0

| 採用済み

回答済み
Plotting the values of a vector
Try this: A=[1 1.1; 1.1 1]; l = [2; 1]/3; B=[1.09 1.44; 1.44 0.99]; w=1; r=linspace(0,1,100); for k = 1:numel(r) p(:...

11日 前 | 0

| 採用済み

回答済み
Error - Undefined function or variable
My apologies for not seeing this Question earlier. I am not certain what you want to do. Taking a guess, this runs without...

11日 前 | 0

| 採用済み

回答済み
Generate array of y values, from the numerical solution of f(y)=x, where x is an array of numbers
There are likely at least two solutions because of the term. I did not exhaustively analyse the function. Try this: f = @...

11日 前 | 0

| 採用済み

回答済み
Coding for different x-axis increments
Use the ‘f’ vector to define the 'XTick' locations: set(gca, 'XTick',f) Full code: g=[0 5 0 0 -10 100 -10 0 0 0 10 0 0 0 0 ...

12日 前 | 0

回答済み
Error when plotting a graph
Use fplot if you have R2016a or later, ezplot otherwise.

12日 前 | 0

| 採用済み

回答済み
Sum of both negative - positive part of a Peak
Try this: x = linspace(6.622, 9.644); y = exp(-(x-mean(x)).^2/0.5) - 0.1; Lv = y>=0; PosPart = trapz(x(Lv), y(Lv)) NegPa...

12日 前 | 1

| 採用済み

回答済み
MATLAB matrices, vectors, and equations help!!!
The ‘CO’ variable is missing. If ‘CO’ is a row vector rathar than a column vector, that could be the problem. If so, the sol...

12日 前 | 1

| 採用済み

回答済み
Returning only positive values of a data set
You cannot do exactly as you want, because the resulting matrix dimensions would not be compatible. Likely the best you can d...

13日 前 | 0

回答済み
FIR filter using windowing method having specs
I have not found a universally-applicable method of calculating the order of a FIR filter. I generally begin with a 48-order F...

13日 前 | 1

回答済み
Error using plot Vectors must be the same length
One option is to plot ‘z’ as a function of the lags xcorr computes: [z,lags] = xcorr(x1,y); subplot 223 stem(lags,z)

13日 前 | 0

回答済み
Error - Vectors must be the same length
Your code does what you want it to, including the if block, and appears to produce the desired results: Mmax = 342....

13日 前 | 0

| 採用済み

回答済み
Unable to perform assignment because the left and right sides have a different number of elements.
Since we do not know more about what you are calculating, the easiest way to deal with this problem is to create a cell array fo...

14日 前 | 0

| 採用済み

回答済み
Connect dots in for loop
Using the loop: Principle = 1; r = 0.08; m = 1; tv = 1:0.5:35; figure for k = 1:numel(tv) t = tv(k); FVd(k) = P...

14日 前 | 1

回答済み
How to plot a ramp waveform function using Matlab?
The definition of a ramp function is important here, and it is not defined in your Question. See if the tripuls or sawtooth fu...

14日 前 | 0

回答済み
Can anyone solve this error
The documentation for the cd function, and the error your code threw, should tell you everything you need to know about it. I...

14日 前 | 0

回答済み
the mysterious for loop
The doubled logical operators are for scalar logical comparisons. Use single logical operators for vector comparisons. The any...

14日 前 | 0

| 採用済み

回答済み
Pressure as a function of crank angle
Two options for the plot, depending on what you want to do: Plot in the loop: figure hold all for alpha=0:0.2:2*pi p=(p...

14日 前 | 0

| 採用済み

回答済み
How can I create new variables from a range in a matrix based on values?
I am not certain what you want. Try this: D = load('spxDrwDwnData.mat'); A = D.spxDrwDwnData; Thr = -0.05; ...

14日 前 | 0

| 採用済み

回答済み
How to not get an ans from function?
There are at least two possibilities. (1) You have omitted a closing semicolon (;) somewhere in the function. (2) You cal...

14日 前 | 0

| 採用済み

回答済み
Stopping a loop on the peak
Change the if block to: if (i > 1) & (M(i)<M(i-1)) break; end and your code appears to give the desired res...

14日 前 | 0

| 採用済み

回答済み
Error using plot Vectors must be the same length.
To create ‘y’ to be the same length as ‘t’, use the 'same' shape argument in conv: y= dt.* conv (x,h,'same');

15日 前 | 0

回答済み
ERROR : "Input arguments must be convertible to floating-point numbers"
The min function is not compatible with symbolic objects, for obvious reasons. Try this instead: b=300; %mm d=400; %mm ...

15日 前 | 1

回答済み
how to create magnitude spectrum signal based on data from excel
Your code needs a few slight improvements: dataset=xlsread('Group3.xlsx','Sheet1','A1:ALM1'); stepsize=0.001; N=1; t=0:step...

15日 前 | 0

| 採用済み

回答済み
How can I solve a system of differential equations where one equation contains the answer to another?
If you have the Symbolic Math Toolbox, let it do the ‘heavy lifting’: syms omegax(t) omegay(t) omegas Omega(t) epsilon sigma a...

15日 前 | 0

| 採用済み

回答済み
cannot get fftshift to shift frequency
You need to create the frequency vector yourself. Probably the easiest way is to use the linspace function. Try this: VAC...

15日 前 | 0

| 採用済み

回答済み
Example ('predmaint/RollingElementBearingFaultDiagnosisExample')
From the documentation on Rolling Element Bearing Fault Diagnosis: ‘For the full dataset, go to this link https://githu...

15日 前 | 0

| 採用済み

回答済み
Passing a vector through a built in function?
Do element-wise multiplication and division: V=sqrt((2*W.*cosd(theta))./(CL*p6000)); ↑ ↑ S...

16日 前 | 0

| 採用済み

回答済み
How do I get the date out of a filename using regexp?
There are likely several ways to approach this. I would do it a bit differently: str = 'xxx_2014_06_03_00_00_01'; fdate = re...

16日 前 | 0

| 採用済み

回答済み
Name the first column in array2table
The code you posted produces an acceptable table object. I am not certain what you want. I am guessing here: coeff = rand(...

16日 前 | 0

| 採用済み

Load more