How would my code be written in psuedocode?

조회 수: 114 (최근 30일)
Raiven Balderas
Raiven Balderas 2018년 2월 10일
댓글: Walter Roberson 2018년 2월 10일
How would my code attached be written in pseudocode? im working on a bisection method. MY code is attached in file

채택된 답변

Walter Roberson
Walter Roberson 2018년 2월 10일
There is no standard for what is required or permitted in pseudocode, so all MATLAB code is also pseudocode.
  댓글 수: 2
Raiven Balderas
Raiven Balderas 2018년 2월 10일
No because my professor said no matlab syntax should be used in pseudocode .... I’m just having a difficult time . Can you put an example of what you think the psuedocode to my code is ?
Walter Roberson
Walter Roberson 2018년 2월 10일
Change everything of the form
A = B;
to
assign B to A
Change every < to "less than", every <= to "less than or equal to", and so on.
Change every & to "and"
Change everything of the form
while CONDITION
to
loop as long as CONDITION is true
Change every "end" matching "if" to "done if", every "end" matching "while" to "done loop"
Change every entry of the form
function [out1, out2, ...] = NAME(in1, in2, ...)
to
create a procedure named NAME with input variables in1, in2, ... returning output variables out1, out2, ...
Not one of these changes are "standard" in any way, and are no more "pseudocode" than your existing code is: they are just syntax changes to get around the requirement that no MATLAB syntax can be used.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by