Trusted by Students Everywhere
Why Choose Us?
0% AI Guarantee

Human-written only.

24/7 Support

Anytime, anywhere.

Plagiarism Free

100% Original.

Expert Tutors

Masters & PhDs.

100% Confidential

Your privacy matters.

On-Time Delivery

Never miss a deadline.

I want to check if a variable doesn't exist and if it doesn't exits I want to run a prompt then set it in the code so the next time it is called the function will by passes the code -- so I only see the data entre once from the user prompt

Computer Science Mar 17, 2023

I want to check if a variable doesn't exist and if it doesn't exits I want to run a prompt then set it in the code so the next time it is called the function will by passes the code -- so I only see the data entre once from the user prompt...  

 

example what I am trying to do

 

I want NOT exist so it runs the code once and after the user input the variable is set to 1 so it never runs again.

 

if exist ('FirstTime')

prompt = {'Enter Bet Amount'};

dlgtitle = 'BlackJack';

dims = [1 40];

definput = {''};

opts.Interpreter = 'tex';

answer = inputdlg(prompt,dlgtitle,dims,definput,opts);

FirstTime = 1

end

Expert Solution

For detailed step-by-step solution, place custom order now.
Need this Answer?

This solution is not in the archive yet. Hire an expert to solve it for you.

Get a Quote
Secure Payment