MATLAB Please write the code for this question.

조회 수: 12 (최근 30일)
수연 김
수연 김 2021년 3월 28일
댓글: Walter Roberson 2021년 3월 31일
Write a program to administer a computerized questionnaire on a topic of interest to you. Use a structure data type and allow participants to answer with whole sentences or phrases for at least some items. Save the data in an external file. Record the time to answer each question.
tic
Subject.name=input('What is your name?','s');
Subject.age=input('How old are you?','s');
Subject.hobby=input('What is your hobby?','s');
Subject.favorite=input('What is your favorite food?','s')
subject
toc
I have to use tic-toc.please help me T.T
  댓글 수: 1
Walter Roberson
Walter Roberson 2021년 3월 28일
You have to record the time to answer each question, so you need a tic/toc around each input() call. And you need to store the value of the toc() call.

댓글을 달려면 로그인하십시오.

답변 (1개)

Mahesh Taparia
Mahesh Taparia 2021년 3월 30일
Hi
You can use tic - toc function and store the time into some variable as given below:
tic
Subject.name = input('What is your name?','s');
nameTime = toc;
tic
Subject.age = input('How old are you?','s');
ageTime = toc;
tic
Subject.hobby = input('What is your hobby?','s');
hobbyTime = toc;
tic
Subject.favorite = input('What is your favorite food?','s');
favTime = toc;
Hope it will help!
  댓글 수: 3
Mahesh Taparia
Mahesh Taparia 2021년 3월 31일
Yeah, its true.
But he has the code, just need to add tic-toc at correct position.
Walter Roberson
Walter Roberson 2021년 3월 31일
But we can discuss how to do it without giving the complete solution, or by showing a single example that does not directly work so that they would have to understand the ideas rather than copying directly.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by