I want to write a program that will read numbers from a file and get the sum of positive numbers, sum of negative numbers and sum of all numbers using FOR and IF function.
Example of numbers in file:(12 3 -4.4 0 9.9 34.45 0 -23.09)
This sounds like it may be a homework problem. This website is a good place to go once you have some specific MATLAB programming problems. Assuming it is homework, you need to get far enough on your own to write some initial code and then you will get lots of help with problems you may be having with your code. If you don't even know enough to get started I would suggest first working with your professor or TA and classmates to get that kind of help. If you don't know enough about MATLAB to write any code then please complete the MATLAB On Ramp training https://www.mathworks.com/learn/tutorials/matlab-onramp.html
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
1 Comment
Direct link to this comment
https://la.mathworks.com/matlabcentral/answers/645643-i-want-to-know-how-to-do-flowchart-and-write-program-for-my-problem#comment_1128803
Direct link to this comment
https://la.mathworks.com/matlabcentral/answers/645643-i-want-to-know-how-to-do-flowchart-and-write-program-for-my-problem#comment_1128803
Sign in to comment.