SlideShare a Scribd company logo
1 of 2
In scilab Write a function named countDown that accepts a total time T in seconds and displays
the time remaining after half of the previously displayed time has elapsed as described below.
The function should also accept an integer Steps as also described below. The function should
immediately display the value of T, then wait T/2 seconds before displaying the value of T/2. It
should then wait T/4 seconds and display the value of T/4, etc. This should continue until only
1/2Steps of the original time remains, at which point it waits for the this remaining time, displays
a 0 and emits an audio tone.
Solution
Solution: See the code below:
------------------------------------------
function countDown(T,steps)
time=T;
while time > (0.5*steps)
disp(time);
time=time/steps;
sleep(time*1000)
end
sleep(time*1000);
disp("0");
beep();
endfunction
countDown(20,2)
-------------------------------------
COUNTDOWN Scilab function that displays decreasing time intervals with tone

More Related Content

Similar to COUNTDOWN Scilab function that displays decreasing time intervals with tone

Part 1 Project Setup, Building the ViewUIIn the video belo.pdf
Part 1 Project Setup, Building the ViewUIIn the video belo.pdfPart 1 Project Setup, Building the ViewUIIn the video belo.pdf
Part 1 Project Setup, Building the ViewUIIn the video belo.pdfamazing2001
 
Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...
Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...
Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...Sivaranjan Goswami
 
Csa ic
Csa icCsa ic
Csa icPCTE
 
Foundations and methods of stochastic simulation
Foundations and methods of stochastic simulationFoundations and methods of stochastic simulation
Foundations and methods of stochastic simulationSpringer
 
Programming timers
Programming timersProgramming timers
Programming timersPRADEEP
 
How to tune a query - ODTUG 2012
How to tune a query - ODTUG 2012How to tune a query - ODTUG 2012
How to tune a query - ODTUG 2012Connor McDonald
 
Microprocessor Week 9: Timer and Counter
Microprocessor Week 9: Timer and CounterMicroprocessor Week 9: Timer and Counter
Microprocessor Week 9: Timer and CounterArkhom Jodtang
 

Similar to COUNTDOWN Scilab function that displays decreasing time intervals with tone (20)

8051 timers--2
   8051 timers--2   8051 timers--2
8051 timers--2
 
Part 1 Project Setup, Building the ViewUIIn the video belo.pdf
Part 1 Project Setup, Building the ViewUIIn the video belo.pdfPart 1 Project Setup, Building the ViewUIIn the video belo.pdf
Part 1 Project Setup, Building the ViewUIIn the video belo.pdf
 
4.Timer_1.ppt
4.Timer_1.ppt4.Timer_1.ppt
4.Timer_1.ppt
 
Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...
Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...
Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...
 
Csa ic
Csa icCsa ic
Csa ic
 
Savitch Ch 02
Savitch Ch 02Savitch Ch 02
Savitch Ch 02
 
Savitch Ch 02
Savitch Ch 02Savitch Ch 02
Savitch Ch 02
 
8051 ch9
8051 ch98051 ch9
8051 ch9
 
Timers
TimersTimers
Timers
 
Lab5 s1
Lab5 s1Lab5 s1
Lab5 s1
 
Foundations and methods of stochastic simulation
Foundations and methods of stochastic simulationFoundations and methods of stochastic simulation
Foundations and methods of stochastic simulation
 
Lab5 s1
Lab5 s1Lab5 s1
Lab5 s1
 
Programming timers
Programming timersProgramming timers
Programming timers
 
Savitch ch 02
Savitch ch 02Savitch ch 02
Savitch ch 02
 
How to tune a query - ODTUG 2012
How to tune a query - ODTUG 2012How to tune a query - ODTUG 2012
How to tune a query - ODTUG 2012
 
C# Loops
C# LoopsC# Loops
C# Loops
 
plc & scaad
plc & scaadplc & scaad
plc & scaad
 
Microprocessor Week 9: Timer and Counter
Microprocessor Week 9: Timer and CounterMicroprocessor Week 9: Timer and Counter
Microprocessor Week 9: Timer and Counter
 
Polyphase
PolyphasePolyphase
Polyphase
 
Lab 1 izz
Lab 1 izzLab 1 izz
Lab 1 izz
 

More from carold12

In managing processes within organizations- what type(s) of methodolog.docx
In managing processes within organizations- what type(s) of methodolog.docxIn managing processes within organizations- what type(s) of methodolog.docx
In managing processes within organizations- what type(s) of methodolog.docxcarold12
 
in Java For any element in keysList with a value greater than 100- pri.docx
in Java For any element in keysList with a value greater than 100- pri.docxin Java For any element in keysList with a value greater than 100- pri.docx
in Java For any element in keysList with a value greater than 100- pri.docxcarold12
 
In Iate 2012- the Micklaus Corporation was formed- The corporate chart.docx
In Iate 2012- the Micklaus Corporation was formed- The corporate chart.docxIn Iate 2012- the Micklaus Corporation was formed- The corporate chart.docx
In Iate 2012- the Micklaus Corporation was formed- The corporate chart.docxcarold12
 
In Fall 1999- people in the financial community were making their fina.docx
In Fall 1999- people in the financial community were making their fina.docxIn Fall 1999- people in the financial community were making their fina.docx
In Fall 1999- people in the financial community were making their fina.docxcarold12
 
In its income statement for the year ended December 31- 2014- Gavin Co.docx
In its income statement for the year ended December 31- 2014- Gavin Co.docxIn its income statement for the year ended December 31- 2014- Gavin Co.docx
In its income statement for the year ended December 31- 2014- Gavin Co.docxcarold12
 
in thin layer chromatography aspirin and caffeine were used as spot- u.docx
in thin layer chromatography aspirin and caffeine were used as spot- u.docxin thin layer chromatography aspirin and caffeine were used as spot- u.docx
in thin layer chromatography aspirin and caffeine were used as spot- u.docxcarold12
 
In the USA are we currently in a period of recession or inflation- Exp.docx
In the USA are we currently in a period of recession or inflation- Exp.docxIn the USA are we currently in a period of recession or inflation- Exp.docx
In the USA are we currently in a period of recession or inflation- Exp.docxcarold12
 
In this Discussion- you will be able to familiarize yourself with the.docx
In this Discussion- you will be able to familiarize yourself with the.docxIn this Discussion- you will be able to familiarize yourself with the.docx
In this Discussion- you will be able to familiarize yourself with the.docxcarold12
 
In the US economy we have two sectors- private and public sectors- In.docx
In the US economy we have two sectors- private and public sectors- In.docxIn the US economy we have two sectors- private and public sectors- In.docx
In the US economy we have two sectors- private and public sectors- In.docxcarold12
 
In the traditional systems development life cycle- users- Are importan.docx
In the traditional systems development life cycle- users- Are importan.docxIn the traditional systems development life cycle- users- Are importan.docx
In the traditional systems development life cycle- users- Are importan.docxcarold12
 
3) IR Spec When it comes to IR analysis- one can choose different meth.docx
3) IR Spec When it comes to IR analysis- one can choose different meth.docx3) IR Spec When it comes to IR analysis- one can choose different meth.docx
3) IR Spec When it comes to IR analysis- one can choose different meth.docxcarold12
 
3) Distinguish among various methods to implement access controlsSolut.docx
3) Distinguish among various methods to implement access controlsSolut.docx3) Distinguish among various methods to implement access controlsSolut.docx
3) Distinguish among various methods to implement access controlsSolut.docxcarold12
 
2D-Array How is the address of an individual element of a 2-dimensiona.docx
2D-Array How is the address of an individual element of a 2-dimensiona.docx2D-Array How is the address of an individual element of a 2-dimensiona.docx
2D-Array How is the address of an individual element of a 2-dimensiona.docxcarold12
 
28- How does the total vapor pressure (VP) and freezing point (FP) of.docx
28- How does the total vapor pressure (VP) and freezing point (FP) of.docx28- How does the total vapor pressure (VP) and freezing point (FP) of.docx
28- How does the total vapor pressure (VP) and freezing point (FP) of.docxcarold12
 
27- The Bohr m odel of the hydrogen atom includes which of the followi.docx
27- The Bohr m odel of the hydrogen atom includes which of the followi.docx27- The Bohr m odel of the hydrogen atom includes which of the followi.docx
27- The Bohr m odel of the hydrogen atom includes which of the followi.docxcarold12
 
25- Question Part Points Submissions Used 1.docx
25-       Question Part   Points   Submissions Used         1.docx25-       Question Part   Points   Submissions Used         1.docx
25- Question Part Points Submissions Used 1.docxcarold12
 
3- Suppose that U-S- government actively uses the fiscal policy to fig.docx
3- Suppose that U-S- government actively uses the fiscal policy to fig.docx3- Suppose that U-S- government actively uses the fiscal policy to fig.docx
3- Suppose that U-S- government actively uses the fiscal policy to fig.docxcarold12
 

More from carold12 (17)

In managing processes within organizations- what type(s) of methodolog.docx
In managing processes within organizations- what type(s) of methodolog.docxIn managing processes within organizations- what type(s) of methodolog.docx
In managing processes within organizations- what type(s) of methodolog.docx
 
in Java For any element in keysList with a value greater than 100- pri.docx
in Java For any element in keysList with a value greater than 100- pri.docxin Java For any element in keysList with a value greater than 100- pri.docx
in Java For any element in keysList with a value greater than 100- pri.docx
 
In Iate 2012- the Micklaus Corporation was formed- The corporate chart.docx
In Iate 2012- the Micklaus Corporation was formed- The corporate chart.docxIn Iate 2012- the Micklaus Corporation was formed- The corporate chart.docx
In Iate 2012- the Micklaus Corporation was formed- The corporate chart.docx
 
In Fall 1999- people in the financial community were making their fina.docx
In Fall 1999- people in the financial community were making their fina.docxIn Fall 1999- people in the financial community were making their fina.docx
In Fall 1999- people in the financial community were making their fina.docx
 
In its income statement for the year ended December 31- 2014- Gavin Co.docx
In its income statement for the year ended December 31- 2014- Gavin Co.docxIn its income statement for the year ended December 31- 2014- Gavin Co.docx
In its income statement for the year ended December 31- 2014- Gavin Co.docx
 
in thin layer chromatography aspirin and caffeine were used as spot- u.docx
in thin layer chromatography aspirin and caffeine were used as spot- u.docxin thin layer chromatography aspirin and caffeine were used as spot- u.docx
in thin layer chromatography aspirin and caffeine were used as spot- u.docx
 
In the USA are we currently in a period of recession or inflation- Exp.docx
In the USA are we currently in a period of recession or inflation- Exp.docxIn the USA are we currently in a period of recession or inflation- Exp.docx
In the USA are we currently in a period of recession or inflation- Exp.docx
 
In this Discussion- you will be able to familiarize yourself with the.docx
In this Discussion- you will be able to familiarize yourself with the.docxIn this Discussion- you will be able to familiarize yourself with the.docx
In this Discussion- you will be able to familiarize yourself with the.docx
 
In the US economy we have two sectors- private and public sectors- In.docx
In the US economy we have two sectors- private and public sectors- In.docxIn the US economy we have two sectors- private and public sectors- In.docx
In the US economy we have two sectors- private and public sectors- In.docx
 
In the traditional systems development life cycle- users- Are importan.docx
In the traditional systems development life cycle- users- Are importan.docxIn the traditional systems development life cycle- users- Are importan.docx
In the traditional systems development life cycle- users- Are importan.docx
 
3) IR Spec When it comes to IR analysis- one can choose different meth.docx
3) IR Spec When it comes to IR analysis- one can choose different meth.docx3) IR Spec When it comes to IR analysis- one can choose different meth.docx
3) IR Spec When it comes to IR analysis- one can choose different meth.docx
 
3) Distinguish among various methods to implement access controlsSolut.docx
3) Distinguish among various methods to implement access controlsSolut.docx3) Distinguish among various methods to implement access controlsSolut.docx
3) Distinguish among various methods to implement access controlsSolut.docx
 
2D-Array How is the address of an individual element of a 2-dimensiona.docx
2D-Array How is the address of an individual element of a 2-dimensiona.docx2D-Array How is the address of an individual element of a 2-dimensiona.docx
2D-Array How is the address of an individual element of a 2-dimensiona.docx
 
28- How does the total vapor pressure (VP) and freezing point (FP) of.docx
28- How does the total vapor pressure (VP) and freezing point (FP) of.docx28- How does the total vapor pressure (VP) and freezing point (FP) of.docx
28- How does the total vapor pressure (VP) and freezing point (FP) of.docx
 
27- The Bohr m odel of the hydrogen atom includes which of the followi.docx
27- The Bohr m odel of the hydrogen atom includes which of the followi.docx27- The Bohr m odel of the hydrogen atom includes which of the followi.docx
27- The Bohr m odel of the hydrogen atom includes which of the followi.docx
 
25- Question Part Points Submissions Used 1.docx
25-       Question Part   Points   Submissions Used         1.docx25-       Question Part   Points   Submissions Used         1.docx
25- Question Part Points Submissions Used 1.docx
 
3- Suppose that U-S- government actively uses the fiscal policy to fig.docx
3- Suppose that U-S- government actively uses the fiscal policy to fig.docx3- Suppose that U-S- government actively uses the fiscal policy to fig.docx
3- Suppose that U-S- government actively uses the fiscal policy to fig.docx
 

Recently uploaded

Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsPooky Knightsmith
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...DhatriParmar
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfPrerana Jadhav
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research DiscourseAnita GoswamiGiri
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmStan Meyer
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...DhatriParmar
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxkarenfajardo43
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptxmary850239
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdfMr Bounab Samir
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17Celine George
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxMichelleTuguinay1
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationdeepaannamalai16
 
Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1GloryAnnCastre1
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQuiz Club NITW
 

Recently uploaded (20)

Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young minds
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdf
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research Discourse
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and Film
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
 
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptxINCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdf
 
Paradigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTAParadigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTA
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentation
 
Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1
 
Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
 

COUNTDOWN Scilab function that displays decreasing time intervals with tone

  • 1. In scilab Write a function named countDown that accepts a total time T in seconds and displays the time remaining after half of the previously displayed time has elapsed as described below. The function should also accept an integer Steps as also described below. The function should immediately display the value of T, then wait T/2 seconds before displaying the value of T/2. It should then wait T/4 seconds and display the value of T/4, etc. This should continue until only 1/2Steps of the original time remains, at which point it waits for the this remaining time, displays a 0 and emits an audio tone. Solution Solution: See the code below: ------------------------------------------ function countDown(T,steps) time=T; while time > (0.5*steps) disp(time); time=time/steps; sleep(time*1000) end sleep(time*1000); disp("0"); beep(); endfunction countDown(20,2) -------------------------------------