Explore BrainMass
Share

MATLAB: Break Function Script

(See attached file for full problem description)

---
How would you rewrite the following script without using break?

for p = 7:8
for q = 3:5
for r = 1:2
fprintf(' %3.0f, %3.0f, %3.0fn' , p, q, r)
end
if q = = 4, break; end
end
end
---

© BrainMass Inc. brainmass.com July 15, 2018, 9:14 pm ad1c9bdddf

Attachments

Solution Summary

A break function script for MATLAB is determined.

$2.19