LogPlot question in a While loop

조회 수: 2 (최근 30일)
Caleb Hedin
Caleb Hedin 2020년 12월 5일
답변: Walter Roberson 2020년 12월 5일
Hello, All
I am trying to understand the logplot commands, here I have a normal plot but I'd like to understand how to make this into a LogPlot, is there a command I can run rather than the "plot" that I have listed?
%ME 383 Lower Handle Cycles
clc
clear all
k_f = 1; %Miscelaneous-effects factor
z_a = 2.236%Found in table A-10 and table 6-5
k_e = 1-0.08*z_a %Reliability factor
k_d = 1 %Temperature factor table 6-4
k_c = 1 %loading factor table figure 6-26 page 290
d = 3/4 %diameter in inches
k_b = .879*d^(-0.178)
a = 24.4 %table 6-2
b = -0.178 %table 6-2
S_ut = 43 %table A-20
k_a = a*S_ut^(b) %surface factor
Sp_e = 0.5*S_ut
S_e = k_a*k_b*k_c*k_d*k_e*k_f*Sp_e
t = 1;
N(t) = 1 ;%estimated number of cycles
while N(t)<10^5
N(t+1) = N(t)+100;
S_f(t+1) = a*N(t+1)^b;
t = t+1;
end
plot(N(2:t), S_f(2:t))

답변 (1개)

Walter Roberson
Walter Roberson 2020년 12월 5일
semilogy(N(2:t), S_f(2:t))

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by