cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Display Array / Vector

ptc-5051640
1-Newbie

Display Array / Vector

Hiya,

Kindly can any one shed some light, for how to show data in the array or vector.

My code is attached below as image.

time.jpg

1 ACCEPTED SOLUTION

Accepted Solutions

use "hold<-match(max(ste),ste)[0"

match will, as already described for lookup, always return a vector, not a scalar. This is necessary as there could be more than one match. The expession above will give you always the first one.

View solution in original post

5 REPLIES 5

Your code isn't attached at all. You should in any case attach the worksheet, not a screenshot. If you cannot do it as of company rules you will have to create a stripped down worksheet with dummy data.

We don't see how time_err is created and therefore can only guess, why you have a vector consisting of 1x1 matrices instead of scalars. Best guess is that you used one of the lookup functions, which always will return a vector, even if they find only a single value.

So if you expected a "normal" vector of scalars you should change the creation of time_err accordingly using the vector subscript.

If you are happy with the vector you have, to SEE the values you should chose to "expand nested arrays" in the format menu you get double clicking the result.

Your data "time_err" is a matrix of matrices, that's what all the [1,1]'s are showing--each cell of time_err is a one element [one row, one column] matrix.

You have several options:

1) select the time_err = statement,

select "format\result"

second tab (Display Options), expand nested arrays

2) Find the code that creates time_err row by row and adjust it so that the result is not a matrix (sometimes

the simple addition of "[0" (array subscript 0) in the right place is all it takes!

time_err.jpg

Nothing effects when I change format/result display option to expand nested array.

Iam just looping for m value and saving max value in time_err, as shown in above code.

use "hold<-match(max(ste),ste)[0"

match will, as already described for lookup, always return a vector, not a scalar. This is necessary as there could be more than one match. The expession above will give you always the first one.

Thanks , got it.

Regards.

Top Tags