Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Matlab 如何找到给定函数的num和denum?_Matlab - Fatal编程技术网

Matlab 如何找到给定函数的num和denum?

Matlab 如何找到给定函数的num和denum?,matlab,Matlab,我想将有理函数分离为num和denom: i、 e x*y/(2*z)==>n=x*y d=2*z 这是我的密码: func = input('Enter the function: '); [n d] = numden(func); disp(n); >> test Enter the function: x*y/(2*z) ??? Error using ==> input Undefined function or variable 'y'. Error in ==&

我想将有理函数分离为num和denom: i、 e x*y/(2*z)==>n=x*y d=2*z

这是我的密码:

func = input('Enter the function: ');
[n d] = numden(func);
disp(n);

>> test
Enter the function: x*y/(2*z)
??? Error using ==> input
Undefined function or variable 'y'.

Error in ==> test at 1
func = input('Enter the function: ');
你必须使用


字符串是否总是以这种形式出现,只有一个斜杠,并且您希望找到左右两侧的部分?它可以是任何形式,例如:x/y/z等于x/(y*z)>>syms x y???对于“char”类型的输入参数,未定义函数或方法“syms”。我认为您需要符号数学工具箱。你安装了吗?
>> syms x y;     
>> [n d] = numden(x*y/(x+y))

n =

x*y


d =

x + y

>>