Why put a semicolon after the last input for an array?
This is an example from a textbook that I’m working with as a beginner. Why would this have semi colons after the 8.99 and -1.50?
updatePriceTable([19.99, 9.99; 14.99, 8.99;], [-1.00; -1.50;], 1)
NOTE:-
Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help , Finance Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.
Suppose that you are writing out several rows of value using code. You write out the initial [ and you start writing values. You reach the end of the first row. You now have three possible strategies:
- Test to see if you are at the last row, and if not then put in ; — and after you leave the loop, put in the ] and continue with whatever you were doing; OR
- write out ; anyhow — and after you leave the loop, put in the ] and continue on with whatever you were doing; OR
- create all of the row-by-row strings in memory, and after you are doing, strjoin() them with ; (which will not put a semi-colon at the end); then put on the ] and write it all out to output, and then continue on
The first strategy requires a last-row test every iteration, which is
SEE COMPLETE ANSWER CLICK THE LINK