Idle Banter For non SV and non bike related chat (and the odd bit of humour - but if any post isn't suitable it'll get deleted real quick).![]() |
![]() |
|
Thread Tools |
![]() |
#1 | ||
Noisy Git
Mega Poster
Join Date: Apr 2007
Location: Halifax/Leeds
Posts: 26,645
|
![]() Quote:
Brings up the menus and stuff fine, works fine with the preset sizes 10x10 40x40 etc. BUT if you select a custom matrix size it throws up Quote:
Checking on the main command menu shows that x and y are set to integers from the X matrix as they're supposed to be. What the b*ll*cky-f*** is wrong with it? Gah!
__________________
Currently Ex Biker
Now rebuilding a 63' fishing trawler as a dive boat |
||
![]() |
![]() |
![]() |
#2 |
Member
Mega Poster
Join Date: Jan 2008
Location: North West
Posts: 3,124
|
![]()
Chris, not familiar with this particular product but...
The section of code you have that does x =X(1,1) y =X(2,1) is setting the x and y variables to non-integer values just before the section that uses the radint function. What does this function do? |
![]() |
![]() |
![]() |
#3 |
Guest
Posts: n/a
|
![]()
inputdlg() reads strings, not numbers...
Use str2num(). |
![]() |
![]() |
#4 | |
Noisy Git
Mega Poster
Join Date: Apr 2007
Location: Halifax/Leeds
Posts: 26,645
|
![]()
Don't have the program here, so apologies if this is painfully obvious. (and generic apologies for the n00b questions!)
So I would swap the inputdlg for str2num? Or use str2num to extract the numbers from the inputdlg results? Also I don't understand why if you check back on the main screen, it has set x and y to integers. Or so it appears. But I will have a look when I get home. Quote:
set y to row 2 column 1 of matrix X
__________________
Currently Ex Biker
Now rebuilding a 63' fishing trawler as a dive boat |
|
![]() |
![]() |
![]() |
#5 | |
Guest
Posts: n/a
|
![]() Quote:
![]() use inputdlg() to read keyboard input, then pass that through str2num() before using in the matrix (or in the x=X(1,1) statement... eg, x=str2num(X(1,1)).) ... Probably neater doing it seperately though. And the main screen shows what it does because it's frankly, pretty random, and attempts class cast conversions where it sees fit. Always did hate MATLAB... But if you're seriously stuck, I know a few folks studying engineering & the likes that use it regular. In fact, one of the lads sat next to me right now does... ![]() |
|
![]() |
![]() |
#6 |
Noisy Git
Mega Poster
Join Date: Apr 2007
Location: Halifax/Leeds
Posts: 26,645
|
![]()
Right what's his phone number and how many gallons of ale is it going to cost me
![]() Bit of background, it's coursework for my engineering course, needing to do conways game of life program with some GUI stuff.
__________________
Currently Ex Biker
Now rebuilding a 63' fishing trawler as a dive boat |
![]() |
![]() |
![]() |
#7 |
Member
Mega Poster
Join Date: Jan 2008
Location: North West
Posts: 3,124
|
![]()
very similar to vbscript this, most of the time it guesses data type correctly but occasionally gets its knickers in a twist.
|
![]() |
![]() |
![]() |
#8 | |
Guest
Posts: n/a
|
![]() Quote:
Another one of the lads will be in work in a couple of hours. He's done more MATLAB than the other guy, and if he's up to some beer money (won't be much) I'll drop you a PM with his contact details. ![]() |
|
![]() |
![]() |
#9 |
Noisy Git
Mega Poster
Join Date: Apr 2007
Location: Halifax/Leeds
Posts: 26,645
|
![]()
That bit now works. Cheers Baph.
Next bit now. Woop.
__________________
Currently Ex Biker
Now rebuilding a 63' fishing trawler as a dive boat |
![]() |
![]() |
![]() |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
For PBX Geeks | TSM | Idle Banter | 5 | 08-08-09 03:34 PM |
geeks- help me | Quiff Wichard | Idle Banter | 24 | 30-01-09 11:27 AM |
Oi geeks. | yorkie_chris | Idle Banter | 64 | 23-11-08 10:06 PM |
So then Geeks | Viney | Idle Banter | 4 | 06-08-07 11:21 AM |
Only for the geeks | falc | Idle Banter | 13 | 08-02-07 06:21 AM |