필터 지우기
필터 지우기

Plotting a graph to show correlation of voltage over current

조회 수: 33 (최근 30일)
Si
Si 2011년 5월 19일
답변: Rehan 2023년 2월 17일
Hi all I'm trying to use some labwork in matlab. I need to plot a graph with the voltage on the y axis and the current on the x axis. The voltage starts at zero and goes up by 2.5v at a time. the resistance of the circuit is known as 10ohms. using the equation I = V / R (current = voltage / resistance) i can work everything i need out im just cant get matlab to plot the graph!!! Any help would be much appreciated
many thanks
simon

채택된 답변

Arnaud Miege
Arnaud Miege 2011년 5월 19일
voltage = 0:2.5:25; % V
resistance = 10; % Ohms
current = voltage / resistance;
plot(current,voltage)
xlabel('Current [A]')
ylabel('Volatge [V]')

추가 답변 (2개)

Yoav Livneh
Yoav Livneh 2011년 5월 19일
R=10;
V = 0:2.5:Vmax;
I = V/R;
figure; plot(I,V)
Type
doc plot
for more information.

Rehan
Rehan 2023년 2월 17일

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by