In this way, the ss2tf function is not read. Other computers can read the same code, but not mine. It has already been reinstalled for the third time and control system toolbox is also installed. What is the solution?

14 comentarios

Ameer Hamza
Ameer Hamza el 1 de Mayo de 2020
Run the command
which ss2tf
and show the output.
Ji Hoon Kong
Ji Hoon Kong el 2 de Mayo de 2020
>> which ss2tf
C:\Program Files\MATLAB\R2020a\toolbox\shared\controllib\general\ss2tf.m
this is my matlab's output
Ji Hoon Kong
Ji Hoon Kong el 2 de Mayo de 2020
Editada: Walter Roberson el 2 de Mayo de 2020
function [num, den] = ss2tf(varargin)
%SS2TF State-space to transfer function conversion.
etc
% Copyright 1984-2011 The MathWorks, Inc.
this is ss2tf.m file's content (or was, before the copyrighted code was deleted)
Walter Roberson
Walter Roberson el 2 de Mayo de 2020
Please show the output of
license('test','control_toolbox')
Ji Hoon Kong
Ji Hoon Kong el 3 de Mayo de 2020
>> license('test','control_toolbox')
ans =
1
>>
Walter Roberson
Walter Roberson el 3 de Mayo de 2020
Please copy and paste the complete error message (not just a picture of the error message; it is easier for us to have it as text, please.)
Ji Hoon Kong
Ji Hoon Kong el 3 de Mayo de 2020
Do you want picture's error message?? i cant understand your question.
Walter Roberson
Walter Roberson el 3 de Mayo de 2020
Is that the complete error message?
You have posted a picture of the error message. I would like to get the characters of the error message so that I can use a translation service as I do not read Korean.
Walter Roberson
Walter Roberson el 3 de Mayo de 2020
I suggest deleting the line and retyping it. you might have an invisible character
Ji Hoon Kong
Ji Hoon Kong el 3 de Mayo de 2020
yeah that is complete error message. 오류발생 mean error occurrence.
other computer's matlab can read that code, but my labtop's matlab cant read ss2tf
Ameer Hamza
Ameer Hamza el 3 de Mayo de 2020
Ji, can you just copy and paste the following line and run it in the command window without typing anything else with it?
[num, den] = ss2tf(a,b,c,d);
Walter Roberson
Walter Roberson el 3 de Mayo de 2020
That error message would not be the one for the case that ss2tf was not found or for ss2tf having an error in its code. That error message can only mean that there is something wrong with the characters or syntax of the line. All other cases would have longer error messages.
Ji Hoon Kong
Ji Hoon Kong el 3 de Mayo de 2020
Editada: Ameer Hamza el 3 de Mayo de 2020
[num, den] = ss2tf(a,b,c,d);
output is
'a' is not unrecognized function or variable.
Ji Hoon Kong
Ji Hoon Kong el 3 de Mayo de 2020
Editada: Ameer Hamza el 3 de Mayo de 2020
my matlab code is
m1 = 1;
m2 = 1;
k = 1;
t = linspace(0,10,173);
a =[0 1 0 0; -1*k/m1 0 k/m1 0;0 0 0 1; k/m2 0 -1*k/m2 0];
b = [0;1/m1;0;0];
c = [0 0 1 0];
%output measurement is the only x2
d = 0;
[num, den] = ss2tf(a,b,c,d);
step(num,den)
and output is
error occurance: ^ (line 51)
The dimensions are incorrect and the matrix cannot be rounded. Verify that the matrix is square and the exponential value is scalar. To perform matrix power operations by element, '.Please use '^'.
error occurance: poly (line 2)
output=x^3+x^2+x+1;
error occurance: ss2tf (line 30)
den = poly(p);
error occurance: asdfg (line 10)
[num, den] = ss2tf(a,b,c,d);

Iniciar sesión para comentar.

 Respuesta aceptada

Ameer Hamza
Ameer Hamza el 3 de Mayo de 2020

0 votos

Ah!! You see. Posting the full error message made the problem clear. You have defined a function named 'poly'. MATLAB also has a function named poly. This confuses MATLAB. Change the name of your function to something else.
Type
which poly -all
it will give you a list of functions. One of those functions was created by you. Change its name to something else.

2 comentarios

Ji Hoon Kong
Ji Hoon Kong el 3 de Mayo de 2020
Thank you for your help. At first, only ss2tf appeared to be an error without these errors, so I thought it was not the cause. I wish you good health.
Ameer Hamza
Ameer Hamza el 3 de Mayo de 2020
I am glad to be of gelp.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Productos

Versión

R2020a

Etiquetas

Preguntada:

el 1 de Mayo de 2020

Comentada:

el 3 de Mayo de 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by