为什么我不能使用开机功能?

时间:2019-05-29 10:39:45

标签: matlab exponent

我写了这段代码:

String.localizedStringWithFormat(NSLocalizedString("next_step", comment: ""), beer)

然后我尝试了此操作->

t=linspace(0,pi)
x = @(t)sin(t)

但是它给我一个错误,那我该如何在一个函数上使用幂函数?

1 个答案:

答案 0 :(得分:6)

不能。

但是,您可以在函数的输出上使用幂函数

x = @(t)sin(t); %this is an anonymous function

t=linspace(0,pi); % this is an array

x2 = power(x(t),2); % this is an array

或者,您可以创建第二个函数来调用第一个函数

x2=@(t)power(x(t),2); % this is  an anonymous function
相关问题