Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
compile not error, the application does not work

Subject: compile not error, the application does not work

From: wahyoe Unggul

Date: 24 Feb, 2011 01:35:22

Message: 1 of 8

hy all
I make an application

file 1
input_volume_silinder.m

disp('perhitungan volume silinder')
r=input('masukkan nilai jari-jari silinder, m = ');
t=input('masukkan nilai tinggi silinder, m = ');
[v]=volume_silinder(r,t);

file 2 (fungtion file)
volume_silinder.m

function [v] = volume_silinder(r,t)
%UNTITLED2 Summary of this function goes here
% Detailed explanation goes here
v=4/3*(0.25*pi*(r^2))*t;
close
disp(['Jari-jari Lingkaran =',num2str(r), ' m'])
disp(['Tinggi Silinder =',num2str(t), ' m'])
disp(['volume =',num2str(v), ' m3'])

I tried to compile the application
>>mcc -m input_volume_silinder

compile not error

after I tried the application, the application opens.
after filling the data and then I run (enter), direct application is closed.
Can help to run this application?

Subject: compile not error, the application does not work

From: ImageAnalyst

Date: 24 Feb, 2011 02:37:35

Message: 2 of 8

What is the point of this line in your code?
close
What do you think that will do?
By the way, the volume of a cylinder is the area times the height. So
where did you get that wrong formula???

Subject: compile not error, the application does not work

From: wahyoe Unggul

Date: 24 Feb, 2011 03:02:04

Message: 3 of 8

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <abd79f6f-ac50-4572-b07b-03a0356ecc07@k17g2000pre.googlegroups.com>...
> What is the point of this line in your code?
> close
> What do you think that will do?
> By the way, the volume of a cylinder is the area times the height. So
> where did you get that wrong formula???

sorry,
the problem is when I tried to compile the file, compile the results there are no error, but after the application was opened and run the results, direct application is closed, about what causes it, is there any validity at compile file

Subject: compile not error, the application does not work

From: wahyoe Unggul

Date: 24 Feb, 2011 03:12:21

Message: 4 of 8

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <abd79f6f-ac50-4572-b07b-03a0356ecc07@k17g2000pre.googlegroups.com>...
> What is the point of this line in your code?
> close
> What do you think that will do?
> By the way, the volume of a cylinder is the area times the height. So
> where did you get that wrong formula???

sorry,
the problem is when I tried to compile the file, compile the results there are no error, but after the application was opened and run the results, direct application is closed, about what the cause, whether there is an error during compile file

Subject: compile not error, the application does not work

From: ImageAnalyst

Date: 24 Feb, 2011 03:35:38

Message: 5 of 8

On Feb 23, 10:12 pm, "wahyoe Unggul" <wahyoe_slip...@yahoo.co.id>
wrote:
> ImageAnalyst <imageanal...@mailinator.com> wrote in message <abd79f6f-ac50-4572-b07b-03a0356ec...@k17g2000pre.googlegroups.com>...
> > What is the point of this line in your code?
> > close
> > What do you think that will do?
> > By the way, the volume of a cylinder is the area times the height.  So
> > where did you get that wrong formula???
>
> sorry,
> the problem is when I tried to compile the file, compile the results there are no error, but after the application was opened and run the results, direct application is closed, about what the cause, whether there is an error during compile file
-------------------------------------------------------------------
Repeating:
"What is the point of this line in your code?
close
What do you think that will do? "

Subject: compile not error, the application does not work

From: wahyoe Unggul

Date: 24 Feb, 2011 04:13:05

Message: 6 of 8

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <93ff19d9-1fcf-4c43-9031-87363bb528f2@u3g2000vbe.googlegroups.com>...
> On Feb 23, 10:12 pm, "wahyoe Unggul" <wahyoe_slip...@yahoo.co.id>
> wrote:
> > ImageAnalyst <imageanal...@mailinator.com> wrote in message <abd79f6f-ac50-4572-b07b-03a0356ec...@k17g2000pre.googlegroups.com>...
> > > What is the point of this line in your code?
> > > close
> > > What do you think that will do?
> > > By the way, the volume of a cylinder is the area times the height.  So
> > > where did you get that wrong formula???
> >
> > sorry,
> > the problem is when I tried to compile the file, compile the results there are no error, but after the application was opened and run the results, direct application is closed, about what the cause, whether there is an error during compile file
> -------------------------------------------------------------------
> Repeating:
> "What is the point of this line in your code?
> close
> What do you think that will do? "

__________________________________________________
the code I am trying to compile, but after I compile, the application (exe) who became unable to walk, after the application is run immediately closed.
I made into two parts, namely:
1. data (input file)
2.pengolah (function file)
then I try to compile with the command
> mcc -m input_volume_silinder

whether to compile 2 files above can use this command?
> mcc -m input_volume_silinder

or is there another way to compile the file?
thanks

Subject: compile not error, the application does not work

From: Steven_Lord

Date: 24 Feb, 2011 16:48:16

Message: 7 of 8



"wahyoe Unggul" <wahyoe_slipnot@yahoo.co.id> wrote in message
news:ik4hnc$ltp$1@fred.mathworks.com...
> ImageAnalyst <imageanalyst@mailinator.com> wrote in message
> <abd79f6f-ac50-4572-b07b-03a0356ecc07@k17g2000pre.googlegroups.com>...
>> What is the point of this line in your code?
>> close
>> What do you think that will do?
>> By the way, the volume of a cylinder is the area times the height. So
>> where did you get that wrong formula???
>
> sorry,
> the problem is when I tried to compile the file, compile the results there
> are no error, but after the application was opened and run the results,
> direct application is closed, about what causes it, is there any validity
> at compile file

That's the correct behavior.

If you were running your function inside MATLAB, when the function finished
executing you'd get back to the command prompt (>> or EDU>>) and MATLAB
would be ready for your next command. In a compiled application, there is
no command prompt -- instead the application as a whole closes when the
function finishes executing.

Open the Command Prompt application using the Windows Start menu (I'm
assuming you're using Windows) and run your compiled application from there;
I believe the results you display will appear in that Command Prompt window.
Alternately, write that text output to a file instead of displaying it to
the screen -- you can control whether the data is displayed or written to
the file using the ISDEPLOYED function if you want the behavior to be
different.

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: compile not error, the application does not work

From: wahyoe Unggul

Date: 25 Feb, 2011 18:47:21

Message: 8 of 8


> That's the correct behavior.
>
> If you were running your function inside MATLAB, when the function finished
> executing you'd get back to the command prompt (>> or EDU>>) and MATLAB
> would be ready for your next command. In a compiled application, there is
> no command prompt -- instead the application as a whole closes when the
> function finishes executing.
>
> Open the Command Prompt application using the Windows Start menu (I'm
> assuming you're using Windows) and run your compiled application from there;
> I believe the results you display will appear in that Command Prompt window.
> Alternately, write that text output to a file instead of displaying it to
> the screen -- you can control whether the data is displayed or written to
> the file using the ISDEPLOYED function if you want the behavior to be
> different.
>
> --
> thanks Steve Lord
Can give examples of logic statements using the function "if" and "case", if you want to go back to the beginning or close an application

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us