plotting a function with values from a table

15 ビュー (過去 30 日間)
Freja
Freja 2023 年 3 月 12 日
編集済み: Dyuman Joshi 2023 年 3 月 12 日
This is the question i am still trying to do and this is my progress so far but im confused as to what I did wrong here, can anyone help me please?

採用された回答

Dyuman Joshi
Dyuman Joshi 2023 年 3 月 12 日
編集済み: Dyuman Joshi 2023 年 3 月 12 日
The question asks to overlay the discrete data on the graph, so you need to define markers on the plot of the discrete data (instead of on the graph).
Also, if you are asking a question on this forum, it would be helpful to attach/paste your code instead of a picture of the code.
%define variable t and calculate variable y
t=0:0.001*pi:0.2*pi;
y=50*sin(5*pi*t+pi/3);
%Plotting the graph
plot(t,y)
hold on
%Define values
s=0:0.1:0.6;
x=[43.3 24.6 -43.7 -26.0 44.1 25.3 -43.3];
%Overlaying the graph with given points
plot(s,x,'ro')
%axes and title labels
xlabel("t(seconds)")
ylabel("y")
title("Graph of y versus t")

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNetworks についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by