Dividing the values of a vector
Try this: A=[1 1.1; 1.1 1]; l = [2; 1]/3; % Create As Column Vector w=1; B=[1.09 ...

5日 前 | 0

Creating a Code to determine Lift Curve Slope
There are several problems with your code. You are only saving the last iteration of ‘A’, and since it does not appear that ‘...

5日 前 | 0

| 採用済み

Parallel form filter design
I am not quite certain what you want to do. To express your elliptic filter as second-order-sections, the Signal Processing T...

5日 前 | 0

Getting a for loop to save a plot every step
Use the same equation and pass the different parameters as extra parameters in a loop. See the documentation secton on Passing ...

5日 前 | 0

how to plot a conventional DSB AM signal
I am not certain how much help you need for this. For a start, see the documentation for the plot function. I am not certain i...

5日 前 | 0

How to formulate and use non linier curve-fitting
Try this: D = dlmread('Example.txt', '\t', 1, 0); objfcn = @(b,x) exp(b(1) - b(2).*x(:,1).*x(:,2)./x(:,3)); ...

5日 前 | 0

| 採用済み

Solving for a system
The easiest way is to loop through the values of ‘ax’: lambda=1.55e-6; %Field in vertical direction axv=linspace(1e-6,2e-6,1...

5日 前 | 0

| 採用済み

How can I show (x,y) of a point in fsurf function?
Try this: Rx = eye(2); Rdx = [2; 4.5]; wo = Rx\Rdx; var_d = 24.4; syms w1 w2 vec_w = [w1 ; w2]; J(w1,w2) = var_d - 2*vec...

6日 前 | 1

| 採用済み

how to find kurtosis in freqeuncy domain
Your best option is likey to use a digital bandpass filter (for 0-2 Hz use a lowpass filter) to isolate those frequency ranges i...

6日 前 | 0

Solving an Equation and then plotting a graph
In these two lines: sigmaSteel=@(c) Es*epss(c) .* (epss(c)<=epsy) + fy .* (epss(c)>epsy & epss(c)<=epssh) + (fsu+(fy-fsu)*abs(...

6日 前 | 1

| 採用済み

Selecting numbers in matrix that are repeated
Try this: A = randi(1000, 60, 5); % Create Matrix [Au,~,ix] = unique(A,'stable'); ...

7日 前 | 0

| 採用済み

Passing parameters in boundary value problem using BVP4C
Define ‘a’ in your workspace, then use this bvp4c call: sol = bvp4c(@(x,y)twoode(x,y,a),@(ya,yb)twobc(ya,yb,a),solinit); You ...

7日 前 | 1

| 採用済み

Unit step function explanation
Use an anonymous function to shorten it even further: u = @(t) t>0; It works by using ‘logical indexing’, so that here, if ‘t...

7日 前 | 1

| 採用済み

How to plot a surface of vector z in a 2D grid made of vectors x and y?
I am not certain what you want the plots to look like, since I am not at all familiar with what you are doing. Try this: fi...

7日 前 | 0

I cant figure out how to make the plot show up
Try this: stage1BurnTimeStart=0; stage2BurnTimeStart=165; stage3BurnTimeStart=360; stage3BurnTimeEnd=500; tv = 6.5:stage3B...

7日 前 | 0

| 採用済み

How to index one array with the index of another array that meets a certain condition
Try this: cloud_type = [0 0 6 8 8 5 1 8 2 2 8]; radius = [20 13 14 25 30 10 5 27 13 14 25]; out = radius(cloud_type==8) p...

7日 前 | 1

| 採用済み

Error :Nonscalar arrays of function handles are not allowed; use cell arrays instead.
The loop is not necessary. This required a few corrections (a typographical error and to vectorise the exponentiation), and n...

7日 前 | 0

| 採用済み

How to write Continue Long Statements on Multiple Lines ?
Use repmat to avoid manually typing all 160 of those ‘%q’ repeats! Try this: formatSpec = ['%f',repmat('%q',1,160), '%[^\n\...

8日 前 | 0

| 採用済み

Positive or zero intercept for linear function
Linearising the exponiential function may not be the best option. I am not certain what you are modeling, however using a nonli...

8日 前 | 0

for loop with different range of number
You can use a for loop, however I would do this instead: r = 1:500; % Create ‘r’ To T...

8日 前 | 0

| 採用済み

How do integrate this function over t=0 to t=165?
I am not certain what you want to integrate, or what you want the final result to be. Try this: mi=2290000; mf=130000; tb...

8日 前 | 0

| 採用済み

How can I apply or implement fir1 filter
Try this: D = load('100m.mat'); EKG = D.val; % Signal L = numel(EKG); ...

9日 前 | 1

| 採用済み

According to the documentation section on the fminsearch Algorithm, the fminsearch function should do what you want.

9日 前 | 0

| 採用済み

How to rescale the y-axis of a histogram?
One approach: X = randn(1, 420); [N,edges] = histcounts(X, 'Normalization', 'probability'); xbar = edges(1:numel(N)) + mean(...

9日 前 | 0

| 採用済み

For Loop plot range of numbers
I cannot follow what you are doing. At the very least, the ‘A_1’ assignment needs to be: A_1(N,:) = ((1./M).*((2/(g1+1)).*(...

9日 前 | 0

zpk function does not work
Run these lines from your Command Window or a script: restoredefaultpath rehash toolboxcache then try what you did before ...

9日 前 | 0

FFT yields two-times the actual frequency
The problem appears to be the way the frequency axis (‘xaxis’) is computed. The limits should be ±Fn, where ‘Fn’ is the Nyquist...

10日 前 | 0

| 採用済み

I get an error saying 'Array indices must be positive integers or logical values' but i need my value to be a decimal. How do i work around this?
I cannot run your code, and I am not certain what you are doing. I do not see that you have defined ‘g’ anywhere, so that may...

10日 前 | 1

| 採用済み

Optical Transfer Function 3D Mesh
Try this: [X,Y] = meshgrid(-1:0.01:1); R = sqrt(X.^2 + Y.^2) + eps; Z = (2/pi)*((acos(R))-(R).*sqrt(1-(R).^2)); figure m...

10日 前 | 0

| 採用済み

How to write x as a function of f(x)?
The Symbolic Math Toolbox has the finverse function: syms x f(x) = (x^2 - 1); finv = finverse(f) producing: finv(x) = ...

10日 前 | 1

| 採用済み