早教吧 育儿知识 作业答案 考试题库 百科 知识分享

这个matlab的M文件为何无法绘制?close all clc clear t=[0:pi/25:8*pi]; y=sin(t); plot(t,y,'b:*'); 错误显示? Attempt to execute SCRIPT plot as a function. Error in ==> plot at 6 plot(t,y,'b:*');还有我在命令窗口输入文件名为何

题目详情
这个matlab的M文件为何无法绘制?
close all clc clear t=[0:pi/25:8*pi]; y=sin(t); plot(t,y,'b:*'); 错误显示? Attempt to execute SCRIPT plot as a function. Error in ==> plot at 6 plot(t,y,'b:*');
还有我在命令窗口输入文件名为何也不行?
>> work.m
? The function, script, or class work
cannot be indexed using {} or . indexing.
或者
>> zsqf1.m
? The function, script, or class zsqf1
cannot be indexed using {} or . indexing.
▼优质解答
答案和解析

没什么问题的,你再吧我的代码复制,运行一遍看看:

clear all;clc;
t=[0:pi/25:8*pi]; 
y=sin(t); 
plot(t,y,'b:*');