Why put a semicolon after the last input for an array?

Technical Source
2 min readNov 7, 2023

--

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:

  1. 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
  2. write out ; anyhow — and after you leave the loop, put in the ] and continue on with whatever you were doing; OR
  3. 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

--

--

Technical Source
Technical Source

Written by Technical Source

Simple! That is me, a simple person. I am passionate about knowledge and reading. That’s why I have decided to write and share a bit of my life and thoughts to.

No responses yet