It is unclear whether you mean to round before or after the division by 4. then note that some of these don't have two or three columns as your loop goes from 1 so the first entry only has 1 column?īut your initial code aside, you should be able to do the following with an 80x1 Cell called m圜ell: for i = 1:80 In answer to your actual question, to "round the values in the second and third columns to the nearest integer divided by 4".īe aware that if you're talking about the Cells A, B, etc. ![]() % Not sure what your further lines are trying to achieve I would like it to round all values to the next whole integer. I tried using round () to do this but in a case where the decimal value is below 0.5 it will round down. The answers can only be a whole integer value. ![]() Mcell = mat2cell(a5n,repmat(174,400,1),3) I am trying to create a program to calculate a module size for solar panels. % code to create Mcell i.e cell array 400 x 1 In response to your code, for a start you don't need so many for loops!ĭo one 1:80 loop containing all the similar lines.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |