WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 06-04-2010, 01:01 AM
ptjt255 ptjt255 is offline
Member
 
Join Date: Oct 2008
Posts: 24
I've tried re-installing everything and I am still getting the error:

Quote:
ImportError: No module named pylab
Any thoughts?

Many thanks,
Catherine.
Reply With Quote
  #2  
Old 06-04-2010, 01:35 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
Try un-installing all those packages through Windows add/remove programs. Then download and run these more recent installers.

matplotlib-0.98.3.win32-py2.4.exe
numpy-1.2.1-win32-superpack-python2.4.exe
wxPython2.8-win32-ansi-2.8.9.2-py24.exe

Make sure they all find Vizard's python installation. Do you still have the same problem?
Reply With Quote
  #3  
Old 06-05-2010, 12:16 AM
ptjt255 ptjt255 is offline
Member
 
Join Date: Oct 2008
Posts: 24
I have managed to get pylab working, which is great news, thanks for all of your help.

I am now trying to convert my MatLab code, which is:

Quote:
dir = input('Path: ');
filename = input('Filename: ');
path = strcat(dir,filename);
eval(['data = textread(path,'''',''headerlines'',1);']);

A = []; B = [];

w = find(data(:,5) == 0);

b = find(data(w,9) == 4);
b1 = data(b,12);
c = find(data(w,9) == 5);
c1 = data(c,12);
d = find(data(w,9) == 6);
d1 = data(d,12);

A = [A; b1(1) c1(1) d1(1)]

carvscar = mean(A)* 2.23693629
ccnorm = 29.41;
ccnorm2 = 27.09;
ccnorm3 = 18.67;
ccnorm4 = 10.97;

x = find(data(:,5) == 2);

e = find(data(x,9) == 4);
e1 = data(e,12);
f = find(data(x,9) == 5);
f1 = data(f,12);
g = find(data(x,9) == 6);
g1 = data(g,12);

B = [B; e1(1) f1(1) g1(1)]

subplot(2,2,[1 3]); bar([carvscar, ccnorm, ccnorm2,ccnorm3,ccnorm4],'FaceColor',[0 0.5 0],'BarWidth',0.5)
subplot(2,2,[1 3]);title(strcat('Car vs Car'));ylabel('Speed Error (mph)','FontSize',11);ylim([0 70])
set(gca,'XTickLabel',{'Your Result';'6-7 year olds';'8-9 year olds';'10-11 year olds';'Adults'})

if data(x,7) == 2 % Truck
carvslorry = mean(B)*2.23693629
clnorm = 54.47;
clnorm2 = 38.81;
clnorm3 = 40.24;
clnorm4 = 15.25;
subplot(2,2,[2 4]); bar([carvscar, clnorm, clnorm2,clnorm3,clnorm4],'FaceColor',[0 0 0.5],'BarWidth',0.5); hold on;
subplot(2,2,[2 4]);ylabel('Speed Error (mph)','FontSize',11);title(strcat('Faster Car vs Slower Truck'));ylim([0 70]);
set(gca,'XTickLabel',{'Your Result';'6-7 year olds';'8-9 year olds';'10-11 year olds';'Adults'})
elseif data(x,7) == 1 % Motorbike
carvsbike = mean(B)*2.23693629
cbnorm = 10; % fictional speed difference, need to get data from Damian
subplot(2,2,[2 4]); bar([carvscar, cbnorm],'FaceColor',[0 0 0.5],'BarWidth',0.5); hold on;
subplot(2,2,[2 4]);ylabel('Speed Error (mph)','FontSize',11);title(strcat('Faster Car vs Slower Motorbike'));ylim([0 70]);
set(gca,'XTickLabel',{'Your Result';'Adults'})
end
I have figured out that to perform the open file procedure it's:

Quote:
dir = 'C:\\Data'
filename = input('Filename: ')
data = open(dir + filename + '.jnk', 'w')
But I can't figure out what the equivelent to:

Quote:
w = find(data(:,5) == 0);
is?

Many thanks!
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 11:51 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC