Protected codes doesn't work on Matlab 2015b as function?

2 visualizaciones (últimos 30 días)
Mirko Musa
Mirko Musa el 17 de En. de 2017
Comentada: Jan el 13 de Nov. de 2019
Hi all, I have a code that uses different subroutines that have been protected, namely are now .p files (I also have the original .m files in the same folder). Running this code with Matlab 2014a had no problem at all. Recently I have upgraded to Matlab 2015b and if I try to run the same code it gave me the error about .p code being generated prior to MATLAB version 7.5 (R2007b) and is no longer supported. "Use pcode to regenerate the file using MATLAB R2007b or later." So I did that, I regenerated the .p codes with pcode using the original .m file. Now, I tried to run my main code and now it is telling me that I am trying to use SCRIPTS as function. Ok, I understand why it would say that but then why it use to work on Matlab 2014a?
I don't know if I was clear in my message but if someone can help I would really appreciate it!
Mirko
  2 comentarios
Tom Langer
Tom Langer el 30 de Nov. de 2018
I'm having the same error...any Mathworks mods available to comment?
Jan
Jan el 30 de Nov. de 2018
Please post the complete error message and the relevant part of the code. If a new P-coding let the error message occur, then the formerly existing P-files do not belong to the M-files you have. By the way: why do you protect code by P-coding, if you have the corresponding M-files available also?

Iniciar sesión para comentar.

Respuestas (2)

Mehmet Ali Öner
Mehmet Ali Öner el 8 de Nov. de 2019
Hello there.
I had the same error. How did you create the .p file in the new version?
I get the following error message. What should I do? Please help me. My Matlab version (R2018b)
The P-code file C:\Users\aa05042\Desktop\lsbstegoprote\hidebits.p was generated prior to MATLAB version
7.5 (R2007b) and is no longer supported. Use pcode to regenerate the file using MATLAB R2007b or later.
Error in test_main (line 19)
[Irec] = hidebits(I,message);
  1 comentario
Jan
Jan el 13 de Nov. de 2019
Please do not post questions in the section for answers. Open your own question would be more useful.
To re-create a P-file you need to have the original M-file. If a P-file is accompanied by an M-file, which contains the help section only, the re-creation will work, but calling the function will fail with a message that you try to access a script as a function.
This means that you need eitehr the original M-file or that you have to contact the author to re-create the P-file.

Iniciar sesión para comentar.


Mirko Musa
Mirko Musa el 12 de Nov. de 2019
Hi,
unfortunately I never found the answer to this problem. I tried a couple of splutions I found on line but none worked.
I ended up changing the way I was solving the problem, which might not be possible in your case.
I am sorry I can't be more helpful at this moment!

Categorías

Más información sobre Programming en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by