Answered
convert a transfer function to controllable and observable canonical form
num = [4]; den = [1 0.8 4]; Gp = tf (num , den); The canon function requesting the 'companion' canonical form directly produc...

6 years ago | 4

| accepted

Answered
why do I get "Undefined function or variable 'tspan'."
The code defines that variable as ‘timespan’. The argument names and the varialble names must always match. Try this: [t,z...

6 years ago | 1

| accepted

Answered
How to graph values of a function above and below 0 as separate functions?
Subscript the elements and provide corresponding time vectors for each one: t= 0:0.2:3*pi; y=sin(t); for k = 1:numel(t) ...

6 years ago | 1

Answered
plot function y axis
Put: ylim([1 100]) after the plot call.

6 years ago | 0

Answered
plot function y axis
Put: ylim([1 100]) after the plot call.

6 years ago | 0

Answered
How can I combine several file.fig together
For each .fig file: F = openfig(filename); Lines = findobj(F, 'Type','Line'); Then, for each element of the ‘Lines’ array: ...

6 years ago | 0

| accepted

Answered
Use entries of symbolic array outside of the array
The reason is that the elements of ‘X’ are stored as matrix elements. The individual elements exist only as matrix elements, no...

6 years ago | 0

| accepted

Answered
What should the order of my FIR filter be?
The fir2 function documentation appears to favour even-numbered filter orders. (The only MATLAB functions that I know of that c...

6 years ago | 0

Answered
Finding and Graphing FWHM (Trouble with Find Function)
Without ‘data_10micronslit.txt’, it is impossible to provide a specific solution. However the findpeaks function will return th...

6 years ago | 0

Answered
Extend linear regression line to an offset
I am not certain what you are asking. Two possibilities: X = [0.6,1.6,2.6,3.6,4.6,5.6,]; Y = [23500, 87780, 153651, 220054...

6 years ago | 0

Answered
Can someone please help?
There are some problems. First, ‘pv’ is not a function of ‘phi’, at least as written. Second, use element-wise operations ...

6 years ago | 0

Answered
How to filter a signal with lowpass/highpass?
The easiest way to determine the sampling frequency is to measure it: D = load('trial1.mat'); A = D.Intensity; t = D.Time; ...

6 years ago | 1

| accepted

Answered
Creating PTn transfer function by
To fit them in the time domain: syms k s T TF1 = k/(T*s+1); TF2 = k/(T*s+1)^2; TF3 = k/(T*s+1)^3; TF1t = ilaplace(TF1);...

6 years ago | 0

| accepted

Answered
I am not getting the solution for my coding.
Try this corrected version of your code: syms q B P S=6; D=4800; A=25; Delta=0.2; F=50; V=1; d=50; tow=0.1; M=7250; ...

6 years ago | 1

Answered
New Script keeps opening in new window instead of a tab
See: New Script keeps opening in new window instead of a tab

6 years ago | 0

| accepted

Answered
Error with accumarray code
For some reason, accumarray doesn’t like the findgroups ‘G’, at least here. I have no idea why it throws those errors, since al...

6 years ago | 1

| accepted

Answered
Multiple runs changing variable for plot
I would use savefig for each figure you want to compare later. All the data and related information as well as the figure itsel...

6 years ago | 0

Answered
ODE 24 "not enough input arguments"
This runs without error (R2020a): function conversion=ODEFUNCTION611b(t,C) V0=200; %dm^3 Kc=1.08; %given equilibirum constan...

6 years ago | 0

| accepted

Answered
multiplying audio signal by using Matlab
The cosine signal must be the same size as ‘y’. One way to define it as such: t = linspace(0, 1, fs); Then create the cosi...

6 years ago | 0

| accepted

Answered
Reading a CSV File that has not Quoted its Strings
I cannot get csvread to imoprt that file at all. However readtable has no problems with it: T1 = readtable('T1811061.24721....

6 years ago | 1

| accepted

Answered
how to determine coordinate from graph
Try this: x = 0:1:20; y = (668.061./x).*[1-exp(-0.1468.*x)]-40; Try this: x = 0:1:20; y = (668.061./x).*[1-exp(-0.1468....

6 years ago | 0

| accepted

Answered
Error using contour (line 48) Z must be at least a 2x2 matrix.
I have no idea what the arguments to your function are, so I cannot run your code. Try this: % Create empty matrix for von ...

6 years ago | 0

Answered
Integrating: I keep getting 'Array indices must be positive integers or logical values.'
Vectorise the square in the first term (replace ^2 with .^2) and the errors will likely go away. (My version of MATLAB will n...

6 years ago | 0

| accepted

Answered
Error when calling parameterized function
Use element-wise operations: function [val] = scalingfunction(x) fun = @(x,y) ((1./(y.^2+1).^(3/2))-(1./((y+x).^2 + 1)).^(3/2...

6 years ago | 0

| accepted

Answered
Issue in using splitapply to plot data
One approach: D = load('val.mat'); val = D.val; G = findgroups(val(:, 3)); figure hold on Y = splitapply(@(x){plot(x(:,...

6 years ago | 2

| accepted

Answered
How to measure the hamming distnace between the rows of a matrix?
Use the pdist2 function, and specifically the Distance argument to specify 'hamming' as the metric. Example — A=[ 0,1,1,1,0...

6 years ago | 1

| accepted

Answered
Non linear simultaneous equation
I am not sure what you want to do with them. Solving them is straightforward: syms Sigma deltaR Eqns = [0.5*1.225*11.05^2...

6 years ago | 0

| accepted

Answered
How to find inverse of a matrix using RREF?
Code it exactly as you wrote it: Ai = rref([A, eye(size(A))])

6 years ago | 0

Answered
Multiplying by the number of the day of each month in a cell arrays
Try this: D = load('test.mat'); test = D.test; T1 = test{1}; % Select Table #1 F...

6 years ago | 1

| accepted

Answered
How to plot a graph of this matrix ?
I would like to see the code that produced that plot from those equations. This is as close as I can get to it: x = [-1 1]*...

6 years ago | 0

| accepted

Load more