I have a matrix read from a text file and I want to subtract more matrix, delimited by the repeating line: 9999 0 0 0 0 0. I want to have as a result 5 different matrix, in this case. How can I do? thank you
Show older comments
501 1.547 0 0 0 0
500 73.164 100.4764 333.3890 1.500 00
502 58.793 99.6720 160.0586 1.500 00
9999 0 0 0 0 0
502 1.560 0 0 0 0
501 58.790 100.4551 60.7974 1.500 00
503 37.525 99.3758 200.0799 1.500 00
9999 0 0 0 0 0
503 1.592 0 0 0 0
502 37.524 100.8832 197.9390 1.500 00
504 69.050 99.8927 277.4128 1.500 00
9999 0 0 0 0 0
504 1.630 0 0 0 0
503 69.060 100.2973 130.6244 1.500 00
501 52.676 101.3383 229.5360 1.500 00
9999 0 0 0 0 0
501 1.547 0 0 0 0
504 52.675 98.8623 77.7161 1.500 00
500 73.164 100.4764 333.3890 1.500 00
As result for example, the first one should be
501 1.547 0 0 0 0
500 73.164 100.4764 333.3890 1.500 00
502 58.793 99.6720 160.0586 1.500 00
the second one
502 1.560 0 0 0 0
501 58.790 100.4551 60.7974 1.500 00
503 37.525 99.3758 200.0799 1.500 00
..........the last one
501 1.547 0 0 0 0
504 52.675 98.8623 77.7161 1.500 00
500 73.164 100.4764 333.3890 1.500 00
5 Comments
Jan
on 7 Jun 2015
The shown result is not a matrix, because it is not rectangular. So please explain exactly, what you want to achieve.
Image Analyst
on 7 Jun 2015
Your "result" is a 1 by 2 row vector followed by a 2 by 6 matrix. Exactly where is the 5 by 5 matrix in the result, and exactly what was subtracted from what to get your result? Like if you did the subtraction C = A - B, what were A and B? And what was C, since it's not your result and we don't see any 5 by 5 matrix in sight?
And you say "depending on the repeating line" but that is not a condition - it's just simply a repeating line and not a true or false condition. So what depends on what? A condition needs to be true or false. For example you might say "depending on if 9999 is in the line, or not in the line"
Loghin Ana-Maria
on 8 Jun 2015
Edited: Loghin Ana-Maria
on 8 Jun 2015
Loghin Ana-Maria
on 8 Jun 2015
Accepted Answer
More Answers (0)
Categories
Find more on Tables in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!