Risposto
I have a row vector consisting of 200 engine speeds. I want to feed one value at a time into an alternator block. How do I do it?
Use *From Workspace* block. Define your data at your workspace, and also define a time vector. These two vectors should be nx1, ...

quasi 6 anni fa | 0

| accettato

Risposto
Stuck with symbolic variables
You need to also convert your numerical array into *symbolic* so that things will be possible. For instance: c=sym(c) c(...

quasi 6 anni fa | 0

| accettato

Risposto
function [CM KG]=STtosi(In,Ib) It is not working
Since you did not mention why the function is not working, it may have two reasons: - Firstly, you need to save your function...

quasi 6 anni fa | 0

| accettato

Risposto
Why do I receive an error message about output arguments for my Embedded MATLAB Function in Simulink?
Simulink wants to know the initial value and size of your output at the very beginning of the simulation. Therefore, add D=0...

quasi 6 anni fa | 0

Risposto
Summing the diagonal of a matrix "the other way"?
This can be done as follows: res=[sum(diag(fliplr(A),3)) sum(diag(fliplr(A),2)) sum(diag(fliplr(A),1)) sum(diag(fliplr(A)))]...

quasi 6 anni fa | 1

| accettato

Risposto
Error states 'Subscript indices must either be real positive integers or logicals' when trying to complete this for loop?
You can not subscript *element zero* of an array. Change your for loop to for i = 1:numel(range) Ti_in(i) = Ti_in -((I...

quasi 6 anni fa | 0

Risposto
can anybody help me with the error?
Make sure that _TrainFeature_ (I assume it is a function) is located in your current working directory.

quasi 6 anni fa | 0

Risposto
How do I perform Partial differential equation by Simulink?
You can't. Only numerical derivatives with respect to time can be calculated in Simulink.

quasi 6 anni fa | 0

| accettato

Risposto
What does 'y:' stand for in plot command?
It means a _dotted yellow line_. For that, you may check the documentation of *plot* command. That third input argument decides ...

quasi 6 anni fa | 0

| accettato

Risposto
How to convert row to matrix with below format????
Something like this should work: A=[3 1 1 4]; Ans=zeros(max(size(A))); r=1:max(size(A)); c=A; idx=sub2ind(s...

quasi 6 anni fa | 1

Risposto
How to plot signal continuously?
Consider the following approach: A=randi([1 5],1,120798); %this is demo data, you will use your own data instead of this T...

quasi 6 anni fa | 0

Risposto
How to extract elements of a matrix coming as output from a simulink block?
See the attached example. I made necessary explanations on the Simulink model. Check the contents of the MATLAB Functions.

quasi 6 anni fa | 0

Risposto
using find function and logical array
Because Z(Z==1) will produce 1 1 1 1 1 which is a new column vector generated from the initial line. ...

quasi 6 anni fa | 0

| accettato

Risposto
When simulating the response to a specific input signal, the input data U must be a matrix with as many rows as samples in the time vector T, and as many columns as input channels.
Try the following code. By the way, I did not understand why you gave *zeros* as input, therefore I changed it with *ones* vecto...

quasi 6 anni fa | 0

Risposto
finding all possible Kp and Kd that makes the system stable?
Define this transfer function in MATLAB command line: Gs=tf([1 2 10],[1 5 8 3 12]); and then write pidTuner(Gs) to...

quasi 6 anni fa | 0

| accettato

Risposto
simulink -dervitive in the s domain
The only possible way that you are going to implement that is to use a *Transfer Fcn* block and set its numerator to _s_ and its...

quasi 6 anni fa | 0

Risposto
solving a differential equation
Use *Symbolic* approach: R=1000;L=0.8;C=1e-3; syms v(t) eq=diff(v,2)+(1/(R*C))*diff(v)+v/(L*C)==0; cond1=v(0)==10;...

quasi 6 anni fa | 0

Risposto
algebric loop error while running
Add a *Delay* or *Unit Delay* block in front of the _Product5_ block in your model to solve the issue.

quasi 6 anni fa | 0

Risposto
unable to compile simulink fft and peak algorithm due to some error.
Enter *Buffer* block and set its _Output buffer size(per channel_ parameter to *3* or to a number more than 3.

quasi 6 anni fa | 0

Risposto
I cant get this plot to work please help me :(
Try this: f1 =@(x) (1./(cosh(x).*cos(x)-1)).*(16.*(-(x.^3).*(cosh(x).*sin(x) + cos(x).*sinh(x))).*(-x.*(cosh(x).*sin(x)-cos...

quasi 6 anni fa | 0

| accettato

Risposto
How transform cell to logical?
Do you want to convert the elements with number to *true*? Try this: test(cellfun(@(x) ~isempty(x),test))={true} Note tha...

circa 6 anni fa | 3

Risposto
Use switch for a matrix row
Use _if_ instead _switch_: if all(M3(i,:)==[0 0 0 0]) if all(M3(i,:)==[1 1 1 1])

circa 6 anni fa | 0

Risposto
how to obtain pid output to 0 to 90 using automatic PID tunner
Are you talking about *saturating* your control signal? There are two options: 1-You can basically use a *Saturation* block f...

circa 6 anni fa | 0

Risposto
Simplification of "for" loop MATLAB R2018a
By the power of *implicit expansion* starting from R2016b in MATLAB, your desire can be achieved in one line of code: r=resh...

circa 6 anni fa | 1

| accettato

Risposto
How to generate all the 3 by 3 matrices ?
One approach: while true A=randi([1 20],3,3); if (2*A(1,1)<=(A(1,2)+A(2,1))) && (A(1,1)<=A(2,2) && A(1,1)<=A(...

circa 6 anni fa | 0

| accettato

Risposto
problem with taking Differentiate from variable with counter !
Well, the approach would be as follows: n=30; x=sym(zeros(1,n));%preallocation syms t for i=1:n x(i)=str2sym...

circa 6 anni fa | 0

| accettato

Risposto
Limit the values of the extreme elements of a vector.
Maybe this will help: low=0;up=10;n=9; A=[0 sort(low+(up-low)*rand(1,n))]

circa 6 anni fa | 0

| accettato

Risposto
How do I find the average of all rows across a series of columns?
You do not need a loop for this. Consider the following case: A=randi([1 4],1000,10);%demo data res=mean(A,2); *res* va...

circa 6 anni fa | 0

| accettato

Risposto
What is the triangular block symbol in this model?
It looks like a _logical operator_. You need to check the *Logical Operator* block for that purpose.

circa 6 anni fa | 0

Carica altro