matlab7中 运行错误matlab7中 >> t=0:pi/150:3*pi; >> y1=cos(t)*exp(-t); 为什么一运行就提示 Error using ==> mtimesInner matrix dimensions must agree.

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/16 12:01:29
matlab7中 运行错误matlab7中 >> t=0:pi/150:3*pi; >> y1=cos(t)*exp(-t); 为什么一运行就提示 Error using ==> mtimesInner matrix dimensions must agree.

matlab7中 运行错误matlab7中 >> t=0:pi/150:3*pi; >> y1=cos(t)*exp(-t); 为什么一运行就提示 Error using ==> mtimesInner matrix dimensions must agree.
matlab7中 运行错误
matlab7中 >> t=0:pi/150:3*pi; >> y1=cos(t)*exp(-t); 为什么一运行就提示 Error using ==> mtimes
Inner matrix dimensions must agree.

matlab7中 运行错误matlab7中 >> t=0:pi/150:3*pi; >> y1=cos(t)*exp(-t); 为什么一运行就提示 Error using ==> mtimesInner matrix dimensions must agree.
t是一个向量,matlab中 * 指矩阵乘.
把 * 改成 .* 应该就可以了