回答済み
How to access only the first element of the variables in a structure array as a vector?
One option S(1).Location = [1 4]; S(2).Location = [4 15]; S(3).Location = [3 7]; L = arrayfun(@(S) S.Location(1),S)

3年以上 前 | 0

| 採用済み

回答済み
Algebraic loop error - Simulink
Hi John, The model equations as implemented are: (1) actual_height = new_height (2) new_height = displacement + actual_heigh...

3年以上 前 | 0

回答済み
Zero pole with 2 poles change s value
I guess you'd first rewrite it in zpk form as K1*Tm/(T1*T2) * (s+1/Tm) / ( (s + 1/T1) * (s + 1/T2) ) so the gain is K1*Tm/T1/T...

3年以上 前 | 1

回答済み
I don't understand this command : F=find(B>4)
B is a 2D matrix. B=[1 2 3 4; 5 6 7 8] This command finds the "linear indices" of the elements of B that satisfy the criteria ...

3年以上 前 | 2

回答済み
Filter coefficients from frequency response with invfreqs/invfreqz
Assuming that f_APSD is in Hz, the filter, h, below gives a reasonable match to APSD. df = 0.1; f_a = 20; f_b = 100; f_c = 30...

3年以上 前 | 1

| 採用済み

回答済み
Use Simulink PreSimFcn to set metadata in a Simulink.SimulationOutput object
Hi Afzal, You can store data into the Simulink.S​imulationO​utput object via the SimPostFcn. Here is an example.

3年以上 前 | 0

回答済み
Confusing error when choosing the appropriate loop opening location for TuningGoal.Sensitivity()
Hi Dhilen, The error message shows up because CL0 does not include those analysis points R_f = 0.1; L_f = 8*10^-3; R_li = 20...

3年以上 前 | 2

| 採用済み

回答済み
Simulink: how to define variable that will remain constant during duration of simulation and use in MATLAB function blocks
For part a), a Tapped Delay block seems like it meets the need. For part b), in the absence of any other information, feed the ...

3年以上 前 | 0

| 採用済み

回答済み
Huge scaling factor on amplitude in NUFFT vs FFT
In the fft section, the variable dft_trajectory is defined as % dft_trajectory = abs(fft(raw_trajectory(:,i))/m); but t...

3年以上 前 | 1

回答済み
How to modify H-infinity controller set up to scale controller output?
Hi Jiten, I believe there are some issue with the code, which I've modified as follows. Define the plant b1 = -356.3851; b2 ...

3年以上 前 | 2

| 採用済み

回答済み
Working with cell arrays
example = [ 5 2.3 1.7 5 0.2 9.1 99 3.3 3.6 99 4.1 3.2 99 5.1 2.2 103 1.1 6.8 ]; G = findgroups(example(:,1)); A = spl...

3年以上 前 | 0

| 採用済み

回答済み
Commenting out Simulink block changes in unrelated system
Hi John, Do you have reason to believe that either pair of responses is correct? Just asking because having some idea what the ...

3年以上 前 | 1

| 採用済み

回答済み
Extract contents of cell array based on rows
Without having example data to try .... result = cellfun(@(A) A(:,3)>3,A,'UniformOutput',false);

3年以上 前 | 0

| 採用済み

回答済み
More accurate alternative to rlocfind to analyze root locus in control systems engineering
Link to answer to a similar question

3年以上 前 | 0

回答済み
How to convert a transfer function into state space representation?
The state space realization of a transfer function is not unique. In fact, there are infinitely many state space realizations t...

3年以上 前 | 2

回答済み
Storing Arrays in a Matrix
Hi Edoardo, The ; concatenates the elements vertically. Use a , to concatenate horizontally x = (1:3).'; y = (4:6).'; % examp...

3年以上 前 | 1

| 採用済み

回答済み
How can we reduce block diagrams in MATLAB using codes?
Hi Hind, Start with this doc page to see options on how to represent each of the Gi and Hi in the diagram. Then see this doc p...

3年以上 前 | 0

回答済み
How would I plot signal energy of a .wav file making sure that time is the value of the x-axis?
Hi Andrew, The energy in a signal is a single number, so it's not clear how one would plot that. The instantaneous power is a ...

3年以上 前 | 0

回答済み
How to find total Steady-State Error due to reference and disturbance
Hi Vivianne, If this problem is to be attacked using the Final Value Theorem, we can proceed either numerically or symbolically...

3年以上 前 | 1

| 採用済み

回答済み
How to change globaly "Sample Time" to milliseconds?
In the Simulink model, you can make the stop time whatever is desired. The simplest way is to just replace the 20.0 with whatev...

3年以上 前 | 0

回答済み
Simulink Matrix multiply error: unexpected scalar signal mismatch
That block mutiplies the inputs from top to bottom as if they are left to right. So that block is really doing xh * Kx, when y...

3年以上 前 | 1

| 採用済み

回答済み
Frenquency shift between the value and plot
Hi Achraf, The signal p is intended to have frequency content at f1 and f2. lbd1 = 1053; f1 = 3e8/(lbd1*10^-9) and f2 = ...

3年以上 前 | 0

| 採用済み

回答済み
I want to integrate a symbolic matrix numerically. How can I do it??
I don't think there's a function for numerically integrating an arrayvalued function of two variables. Here's a loop approach to...

3年以上 前 | 0

回答済み
How do I get rid of the sinusoidal wave in my output waveform for fourier series sawtooth waveform?
Hi Chaileen, It looks like you're trying to use a summation like this: for n = 1:8 y2 = y2 + B(n)*sin(2*pi*n*t2/(T0)) en...

3年以上 前 | 0

回答済み
Find the nonzero maximum frequency corresponding to FFT graph.
If the DC offset is of interest (or even if it isn't) [maxSOa,index] = max(SOa(2:end)); % ignores first point a f=0 F_fake = f...

3年以上 前 | 0

回答済み
I dont understand why the variable x is incorrect.
Hi Nam, What is the justification for the computation of r(1,:)? If you're trying to find the extrema of J0, why use fsolve to...

3年以上 前 | 0

回答済み
Programmatically change MATLAB Fcn Block Function Configuration Script
Hi Aarish, This worked for me. config = get_param(gcb,'MATLABFunctionConfiguration'); % Matlab Fcn block selected in Simulink ...

3年以上 前 | 0

| 採用済み

回答済み
Finding intersection of rlocus branch and a line at an angle
One way would be to use the output arguments from rlocus to get the closed loop pole locations and the associated gain. Here's ...

3年以上 前 | 0

回答済み
Step() not working as expected with USS state space (Uncertain Sys)
Hi John, Disclaimer: I'm not really a user of the Robust Control Toolbox. I'm not quite sure how to interpret the discretizati...

3年以上 前 | 1

| 採用済み

回答済み
Applying array of transform matrices to array of vectors
Check out pagemtimes. Whether or not it's faster than a loop ... would need to be tested on your system D = rand(3,3,700); v ...

3年以上 前 | 0

| 採用済み

さらに読み込む