How to Plot variation of an output?

8 ビュー (過去 30 日間)
Nataly Orozco
Nataly Orozco 2020 年 9 月 22 日
回答済み: Deepak Meena 2020 年 9 月 25 日
I am trying to plot a graph that will give me a different value for every x from 1-100 from an equation, but I don't use matlab so I am not sur ehow to do so or where to begin. I was thinking of using a loop to extract those one hundred value pairs, but idk how to plot them all in a graph. I will attach the homeowkr problem I am dealing with so you can get an idea of what I am being asked of.

回答 (1 件)

Deepak Meena
Deepak Meena 2020 年 9 月 25 日
Hi Nataly,
Follow the steps below :
x = [ 1 : 1:100];%creating a array from 1 to 100 with step of 1
Cps = 1.2;%defining constants
Cdc = 1.5;
Vout = Cps*log(x) + Cdc;%by default log in matlab calculate w.r.t to base e and when function is
%applied to array it get applied to each element.
plot(x,Vout); %plotting the distance on X axis and VOut on Y axis

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by