Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Batch Reading BMP Files

Status
Not open for further replies.

TheLeech

Bioengineer
Joined
Feb 4, 2006
Messages
2
Location
BE
Does anyone know it is possible to read multiple files into matchcad using 1 command. My BMP's are called Image0.bmp, Image1.bmp, ... etc. I need to convert them to matrices containing the grey values. Out of these matrices I need to extract grey values and then I wish to write these values into a file. Because I do not whish to load over a 100 BMP's into Matchcad manually, I was hoping anyone could help me.

PS: when using for instance "for i from 0..100 READBMP("Imagei.bmp") won't work ofcourse.

Many thanks in advance
 
Why "of course?"

Did you read the definitions of the string functions?

TTFN



 
What version of Mcad are you using?

Current versions allow the argument of read/write commands to be a variable as below:
images:= |a<-"c:/folder/image"
|for i from 0...100
| file<-concat(a,num2str(i),".bmp")
| output(sub i) <- READBMP(file)
|output

However, I believe that older versions did not allow this. I'm not sure when that changed, maybe with v11?

Peter
 
Thanks guys,

I have MatchCad version 11.0a. My first screening of the tutorials was not succesful. That's why I assumed it wasn't possible. I'll start looking it up right now. Hopefully my Mathcad version allows this.

Thank you for a quick reply!

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top