0% found this document useful (0 votes)
54 views2 pages

Pseudo Flow Ref

This document provides a reference for flowchart symbols, corresponding pseudocode, and MATLAB examples for common programming structures like functions, loops, conditionals, and I/O. It includes flowchart symbols for processes like beginning/ending an algorithm, selection, repetition, and function calls. The pseudocode and MATLAB examples demonstrate how to represent these structures in code with proper indentation. Notes are provided on writing pseudocode and MATLAB code that clearly shows the program structure.

Uploaded by

Mahdi Mahendra
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views2 pages

Pseudo Flow Ref

This document provides a reference for flowchart symbols, corresponding pseudocode, and MATLAB examples for common programming structures like functions, loops, conditionals, and I/O. It includes flowchart symbols for processes like beginning/ending an algorithm, selection, repetition, and function calls. The pseudocode and MATLAB examples demonstrate how to represent these structures in code with proper indentation. Notes are provided on writing pseudocode and MATLAB code that clearly shows the program structure.

Uploaded by

Mahdi Mahendra
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Copyright C. S. Tritt, Ph.D.

Pseudocode and Flowchart Reference (Matlab Version 1.01)

Last revised March 22, 2007

Operation

Flowchart Symbol

Pseudocode

Indented Matlab Examples


function res = myFunc(arg) end

Begin or End of Algorithm

Start MyFunc

Begin myFunc End myFunc

Process/Assignment

new old + 1.5

new old + 1.5 -orold + 1.5 new

new = old + 1.5;

Input/Output

Input [stream] x, y

Input z from source Output x & y to dest

z = input('Enter value: '); disp(['Result = ' result]); fprintf(outfile, 'x = %5.2f', x);

F
Selection

x = y? T

if cond then block else block next step

if x == y else end

See also switch/case and try/catch.

J=0
Counter Controlled Loop

F J <= 10

J=J +1 T
1

for j = 1, 10 block next step

for ind = 1:10 end

Copyright C. S. Tritt, Ph.D.

Pseudocode and Flowchart Reference (Matlab Version 1.01)

Last revised March 22, 2007

do/while z x/y

Structured Repetition
y>0 F T

while cond block next step

while y <= YMAX end

General Repetition (See note below)

See Selection and Structured Repetition symbols

while block if cond break block next step home(x,y) z myfunc(x) -ormyfunc(x) z

while true if isDone break end end

Function Call

home(x,y) or z myfunc(x)

plot(myX, myY); z = mix(x,y);

Notes and Comments: The flowchart, pseudocode and Matlab examples do not generally correspond (i.e., they dont necessarily represent the same action). Use indentation to show structure in pseudocode and Matlab source code. cond is a logical condition (a Boolean expression). next step mans the next step in the algorithm. In Matlab, this can generally be any statement. source and dest means any open data source or destination of the appropriate type. Some coding styles prohibit General Repetition structures. If general repetition is used, there should only be one way in and one way out.

You might also like