The following code works to generate three values (cedar, fir and decid) that add to 1.0. I am new to matlab. How would I code this so that it would do the same thing for cedar = 0.01, cedar = 0.02, cedar = 0.03 and so on to cedar = 1.0 and output the values as a long table.

format bank cedar = 0; fir = 0; decid = 0; conifer = 0; for cedar = 0 while (conifer <= 1.0) fir = fir + 0.01; conifer = cedar + fir; decid = abs(1.0 – conifer); disp([cedar fir decid]); end end

## Best Answer