这是一道关于Matlab的题,write the MATLAB program to calculate the values of the functionfor at intervals of .Do this twice,once using loops and branches,and once using vectorized code.这是那个函数

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/07 00:44:08

这是一道关于Matlab的题,write the MATLAB program to calculate the values of the functionfor at intervals of .Do this twice,once using loops and branches,and once using vectorized code.这是那个函数
这是一道关于Matlab的题,
write the MATLAB program to calculate the values of the function
for at intervals of .Do this twice,once using loops and branches,and once using vectorized code.
这是那个函数

这是一道关于Matlab的题,write the MATLAB program to calculate the values of the functionfor at intervals of .Do this twice,once using loops and branches,and once using vectorized code.这是那个函数
你的题目问题不完整,你的interval没有给出具体的值,就是那个“at intervals of .”这里没有东西.我假设这里是interval = pie/100,然后给你一个参考.我的t取值范围是 -pie 到 pie,自己可以改成任意pie的取值范围.
t = -pi:pi/100:pi;
n = size(t,2);
f = zeros(1,n);
% using loops to calculate the values of the function
for i = 1:n
if t(i)>0
f(i) = sin(t(i));
else
f(i) = 0;
end
end
% using vectorized code to calculate the values of the function
tl = t>0;
t = t.*tl;
f = sin(t);
需要什么解释可以给我留言!

这是一道关于Matlab的题,write the MATLAB program to calculate the values of the functionfor at intervals of .Do this twice,once using loops and branches,and once using vectorized code.这是那个函数 matlab的一道题 一道关于MATLAB的题 数字相加,1到100 ,如何使用MATLAB 这是一道关于导数的题, 在线等~~一道关于matlab的数学题~高分等啊! 一道简单的matlab画图题 . 求解matlab的一道关于数值分析的算法感激不尽~~~~~~~就是讲解下这道算法是什么意思?谢谢。。。。。 这是一道关于初二的等腰三角形的题 这是一道关于初二的等腰三角形的题 这是关于正余弦定理的一道题 这是一道关于元素周期的问题, 一道关于stop用法的题Miss Wang told us to stop ( ) to her.A.to write and listenB.writing and listening C.to write and listeningD.writing and to listen并解释其其原因和句子的意思. 用MATLAB解一道题 write the plural form of each of the follow works.这是英语练习册上一道题的题目,不...write the plural form of each of the follow works.这是英语练习册上一道题的题目,不知道该怎么答. 关于英语一道题.They enjoy the story ( )by a man.A:wrote B:written C:was written D:write 这里为什么选B不选其他的? 一道简单的matlab入门题 求大侠指导 matlab高手请进!关于matlab的我们matlab选修课作业就是要求用matlab做一道题目,没有具体要求,但是老师说有点难度比较好,而我根本没听课,连matlab是什么都不知道, 关于matlab的一道题F1=(9-3t),F2=(3+2t)A1=F1/1 A2=F2/2t=[0:0.1:6]要求画图 t是横坐标,A1 A2在一起