×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Can't afford Compiler - Octave not compatible

Can't afford Compiler - Octave not compatible

Can't afford Compiler - Octave not compatible

(OP)
I have a 2 simple m-files that I need compiled into an exe.  My budget can't afford to purchase the Matlab Compiler for this little project.  I have been working with Octave / Scilab / Freemat to try to get this file to convert and compile.  I have had no luck.  It seems there are too many non compatible functions between matlab and the OSS versions.  The main problem seems to be the uigetfile dialog box and file i/o functions.  

This code isn't mine and I'm a noob to Matlab.  

My question is... Is there any free compilers / good FAQ that will help me in this situation?  I'm about out of options here. If this job look as simple as I think it is, can someone compile it for me? Karma Opportunity!

Here is the code:
Code and Data file 8MB
I have a data file if someone wants to try this out.
getertblk.m

CODE

%quick test file to try and pull 3d values from img plot for eet modeling
%
%Clark Scott
clear all

%% Get .img file name %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[fnam fdir]=uigetfile('*.img','*.img');
fid=fopen([fdir fnam],'rt');

%% Get number of x y and z nodes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
temp=[fliplr(deblank(fliplr(fgetl(fid)))) ' '];
while temp(1)~='t';temp=[fliplr(deblank(fliplr(fgetl(fid)))) ' '];end;
nx=str2num(deblank(temp(end-2:end)));
temp=fgetl(fid);
ny=str2num(deblank(temp(end-2:end)));
temp=fgetl(fid);
nz=str2num(deblank(temp(end-2:end)));

fprintf(1,'the vales for nx ny and nz are;  %4d %4d %4d \n Continue? \n',nx,ny,nz);
drawnow
pause

%% Show iteration list %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
blkpos=[];itnvec=[];curpos=0;
while ~feof(fid)
    tempold=temp;
    temp=[fliplr(deblank(fliplr(fgetl(fid)))) ' '];
    while temp(1)~='i' & ~feof(fid)
        tempold=temp;
        temp=[fliplr(deblank(fliplr(fgetl(fid)))) ' '];
    end
    if ~feof(fid)
        blkpos=[blkpos ftell(fid)];
        delcur=ftell(fid)-curpos;  %skip most of the data block to make listing faster
        curpos=ftell(fid);
        fseek(fid,floor(delcur*.95),0);
        itnvec=[itnvec str2num(temp(12:15))];
        disp([temp(1:15) ' - ' tempold]);
    end
end
itnvec(1:5)=1:5;
disp(' ')

%% Find location of given iteration block and read data %%%%%%%%%%%%%%%%%%%%%%%%%%
itn=input('Which iteration number do you want? ==> ');
if ~isempty(itn)
    idn=find(itnvec==itn);
    fseek(fid,blkpos(idn),-1);

    for l=1:nz
        temp=[fliplr(deblank(fliplr(fgetl(fid)))) ' '];
        disp(temp);
        for col=1:ny
            coltemp=fscanf(fid,'%d',[1]);
            X(:,col,l)=fscanf(fid,'%f\n',nx);
        end
    end
    X=flipdim(X,3);
   X=flipdim(X,1);

    disp(['Finished loading iteration #' num2str(itn) ' from file ' fnam]);
else
    disp(['No iteration block chosen' ' from file ' fnam]);
end

pltall.m

CODE

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%pltall.m - a quick and dirty plotting routine for MPT3D .img files
%% get base number of plot wanted
%% 1 - X-Direction Resistivities
%% 2 - Y-Direction Resistivities
%% 3 - Z-Direction Resistivities
%% 4 - Geometric Mean Resistivities
%% 5 - Vertical/Horizontal Anisotropy
%% 6 - Output Y_direction parameter info**
%% 7 - Output Y_direction parameter info**
%% 8 - Output Z_direction parameter info**
%%  ** - Last iteration only
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

help pltall %%  Show above
if ~exist('X');getertblk;end   %%get data (This script clears variable space before running)

%% Get info from user %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
disp(' ')
itn=input('Which base number do you want? (1:5)==> ');
disp(' ');
plnor=round(input('Which plane orientation (1-XZ, 2-YZ, 3-XY)? ==> '));
if plnor<1 | plnor>3 | isempty(plnor);plnor=1;disp('Orientation defaulted to XZ');end;
disp(' ');
fprintf(1,'the vales for nx ny and nz are;  %4d %4d %4d \n',nx,ny,nz);
drawnow
disp(' ');
disp('Which plane do you want from this orientation? Number');
plnnum=input('between 1 and values given above ==> ')
clc
temp=['XZ';'YZ';'XY'];
disp(['Program will plot plane ' num2str(plnnum) ' in the ' temp(plnor,:) ' orientation' ]);
disp(['from all iterations in the ' fnam ' file' ]);
disp(' ');
disp('Continue?');
pause

%%Get plot params %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
itn=[0+itn:10:itnvec(end)];


if length(itnvec)/5<10
   ncol=3;
else
   ncol=4;
end
nrow=ceil(length(itn)./ncol);
ncol=7;
nrow=3;
%% Loop over iterations and plot %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
figure;
for j=1:length(itn)
    idn=find(itnvec==itn(j));
    fseek(fid,blkpos(idn),-1);
    for l=1:nz
        temp=[fliplr(deblank(fliplr(fgetl(fid)))) ' '];
    %    disp(temp);
        for col=1:ny
            coltemp=fscanf(fid,'%d',[1]);
            X(:,col,l)=fscanf(fid,'%f\n',nx);
        end
    end
    %% Get plane form block (stored as 3-D array with dimension order as X Y Z
    if plnor==3
        d=(squeeze(X(:,:,plnnum)));
    elseif plnor==2
        d=(squeeze(X(plnnum,:,:)));
    else
        d=(squeeze(X(:,plnnum,:)));
    end
    %% Plot data
    d=d';
    
    subplot(nrow,ncol,j);
    pcolor((d));
    axis ij
    
    V=[1 1000];
%    if j>20
       caxis(V)
%    end      
    shading interp;axis equal;colorbar;
%   if j<3
%       V=caxis;
%   end
   title(['itr #' num2str(j-1) ', Block#' num2str(itn(j))],'interpreter','none');
%   ylabel('Z');xlabel('X');
   drawnow
end

set(gcf,'position',[1 1 1280 1024])
gtext(['Savage - ' fnam],'interpreter','none','fontsize',16);
%ptflg=0;
%home
%ptflg=input('Do you wish a JPG image ([Y]/N) > ','s');
%if isempty(ptflg) | ptflg=='Y' | ptflg=='y'
%    set(gcf,'PaperPositionMode','auto');
%    print('-djpeg99',['plot' fnam]);
%    close
%end

disp(['finished ' fnam]);

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources