From: mat001 on
"Steve Amphlett" <Firstname.Lastname(a)Where-I-Work.com> wrote in message <hkujc1$a4f$1(a)fred.mathworks.com>...
> "mat001 " <priya.biomath(a)gmail.com> wrote in message <hkuef1$i8m$1(a)fred.mathworks.com>...
> > "Saravanan Mani" <saravanan.ms55(a)gmail.com> wrote in message <hku6sk$e9q$1(a)fred.mathworks.com>...
> > > I need to convert p-file in own source m-file, are there some methods?
> >
> >
> > You can not convert p to m in principle. pcode just a protection layer over the m files.
> > protection layer not code.
> > Do not try better to ask the person if you really need his code.
>
> Not strictly true. It's not a layer OVER the m-files. They're history and cannot be reconstructed.

what do u mean by history here?
can you explain little more.
From: Steve Amphlett on
"mat001 " <priya.biomath(a)gmail.com> wrote in message <hl0jks$61v$1(a)fred.mathworks.com>...
> "Steve Amphlett" <Firstname.Lastname(a)Where-I-Work.com> wrote in message <hkujc1$a4f$1(a)fred.mathworks.com>...
> > "mat001 " <priya.biomath(a)gmail.com> wrote in message <hkuef1$i8m$1(a)fred.mathworks.com>...
> > > "Saravanan Mani" <saravanan.ms55(a)gmail.com> wrote in message <hku6sk$e9q$1(a)fred.mathworks.com>...
> > > > I need to convert p-file in own source m-file, are there some methods?
> > >
> > >
> > > You can not convert p to m in principle. pcode just a protection layer over the m files.
> > > protection layer not code.
> > > Do not try better to ask the person if you really need his code.
> >
> > Not strictly true. It's not a layer OVER the m-files. They're history and cannot be reconstructed.
>
> what do u mean by history here?
> can you explain little more.

I mean that the donor m-file cannot be reconstructed or extracted. It's a one-way trip.
From: Jan Simon on
Dear Saravanan!

> I need to convert p-file in own source m-file, are there some methods?

You can inspect the contents of a P-file and the communication with other functions using the debugger of Matlab. For P-files of Matlab 6 there are some further techniques to get the contents of the original file, but for the modern Matlab versions the P-files are encrypted.

The main problem is usually the conflict with the license conditions of the program!
In every case, digging in a P-code takes usually much more time and knowhow than re-programming it! So my first approach would be to offer 1000$ (or more) to the author to send me the M-file. If it is not worth to spend this money, forget it.

Kind regards, Jan
From: Steven Lord on

"Steve Amphlett" <Firstname.Lastname(a)Where-I-Work.com> wrote in message
news:hl0k9e$gso$1(a)fred.mathworks.com...
> "mat001 " <priya.biomath(a)gmail.com> wrote in message
> <hl0jks$61v$1(a)fred.mathworks.com>...
>> "Steve Amphlett" <Firstname.Lastname(a)Where-I-Work.com> wrote in message
>> <hkujc1$a4f$1(a)fred.mathworks.com>...
>> > "mat001 " <priya.biomath(a)gmail.com> wrote in message
>> > <hkuef1$i8m$1(a)fred.mathworks.com>...
>> > > "Saravanan Mani" <saravanan.ms55(a)gmail.com> wrote in message
>> > > <hku6sk$e9q$1(a)fred.mathworks.com>...
>> > > > I need to convert p-file in own source m-file, are there some
>> > > > methods?
>> > >
>> > >
>> > > You can not convert p to m in principle. pcode just a protection
>> > > layer over the m files.
>> > > protection layer not code.
>> > > Do not try better to ask the person if you really need his code.
>> >
>> > Not strictly true. It's not a layer OVER the m-files. They're history
>> > and cannot be reconstructed.
>>
>> what do u mean by history here?
>> can you explain little more.
>
> I mean that the donor m-file cannot be reconstructed or extracted. It's a
> one-way trip.

Assuming you overwrite or delete the existing M-file explicitly after
generating the P-file, that's correct. However, if you call it on its own
PCODE creates a new file with the extension .p and so your existing file is
fine.

>> ls

.. mytestfcn.m
...

>> pcode mytestfcn.m
>> ls

.. mytestfcn.m
... mytestfcn.p

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ