Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Jun 28, 2019
01:46 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Jun 28, 2019
01:46 PM

Value must be a vector

Hello,

I am trying to simulate result in arrays but it is giving me an error that value must be a vector. I have tried to search my worksheet but am unable to identify the problem. Please help me with this. My version is prime 4.0

Thanks,

Faisal

Solved! Go to Solution.

Labels:

1 ACCEPTED SOLUTION

Accepted Solutions

Jun 28, 2019
02:58 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Jun 28, 2019
02:58 PM

I have some tracing back the various function calls made (OK, honestly I'm to lazy to do so), but using Primes very basic trace feature I was able to trace back to function Lambda.

Obviously with the data you provide, function "a" does not return a vector, but a simply scalar and so "sort" throws that error. Probably because x.guess is not a vector.

6 REPLIES 6

Jun 28, 2019
02:58 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Jun 28, 2019
02:58 PM

I have some tracing back the various function calls made (OK, honestly I'm to lazy to do so), but using Primes very basic trace feature I was able to trace back to function Lambda.

Obviously with the data you provide, function "a" does not return a vector, but a simply scalar and so "sort" throws that error. Probably because x.guess is not a vector.

Jul 01, 2019
11:10 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Jul 01, 2019
11:10 AM

I think the lambda returns a value as xguess is in a vector (file attached). But I have no idea why it is saying that it must be a vector

Jul 01, 2019
11:49 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Jul 01, 2019
11:49 AM

The problem seems to be the vectorization in your function Phi.

It also vectorizes x.guess making it a scalar.

Look if the modified function Phi now does what you expect. I got rid of a lot of unnecessary and confusing parenthesis and I left vectorization even though it would not be needed as far as I see as you call the routines with scalars only.

Jul 01, 2019
01:57 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Jul 01, 2019
01:57 PM

can you please send me a prime 4.0 version of the file

Jul 01, 2019
02:14 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Jul 01, 2019
04:00 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Jul 01, 2019
04:00 PM

thank you