1 страниц (3 вхождений)
Creating a new Matrix by Sorting Through a Different Matrix - Сообщения
#1 Опубликовано: 28.09.2014 16:41:44
I'm trying to program a loop which runs through a vector matrix and throws out values which I don't want and puts values I do want into a new matrix.
Lets give 2 situations:
The first -> I want to check a column matrix which has a number of heights say, 10ft, 20ft, 30ft, 50ft. I want to set a certain height, say 25ft. The loop should check each height if it is greater than 25ft. If it is greater than 25ft than disregard the value. However the last value of the new matrix should be 25ft. So in the end it would be 10ft, 20ft, 25ft
Second -> You have a column matrix of random values. You only want values between X and X', the rest may be discarded.
Thanks in advance for any suggestions!!
Lets give 2 situations:
The first -> I want to check a column matrix which has a number of heights say, 10ft, 20ft, 30ft, 50ft. I want to set a certain height, say 25ft. The loop should check each height if it is greater than 25ft. If it is greater than 25ft than disregard the value. However the last value of the new matrix should be 25ft. So in the end it would be 10ft, 20ft, 25ft
Second -> You have a column matrix of random values. You only want values between X and X', the rest may be discarded.
Thanks in advance for any suggestions!!
#2 Опубликовано: 28.09.2014 16:47:53
I think I solved situation 1 using "Break" (which I forgot I could use in SMath) but it does throw an error message see below:

#3 Опубликовано: 03.10.2014 22:14:14
Thanks again Ioan!
So for the first problem -> use of a counter and the continue argument, very nice.
For number 2:
First sort the information which is subject to the demands.
Next find the rows minimum and maximum rows and keep these to resize the matrix. kkk=0 is basically a do nothing command.
Then we define a submatrix which only has the data between the demands and in this case returns the entire row of the matrix.
Very good, Thank you!!
So for the first problem -> use of a counter and the continue argument, very nice.
For number 2:
First sort the information which is subject to the demands.
Next find the rows minimum and maximum rows and keep these to resize the matrix. kkk=0 is basically a do nothing command.
Then we define a submatrix which only has the data between the demands and in this case returns the entire row of the matrix.
Very good, Thank you!!
1 страниц (3 вхождений)
-
Новые сообщения
-
Нет новых сообщений