WorksheetsMATLAB 2EEE
Total questions: 118
Worksheet time: 3570secs
Display the value (only) of the variable X
(a)
Generate 50 logarithmically-spaced points between 102 and 107
(a)
Create a matrix of 3x3 random numbers, called R
(Uniformly distributed numbers between 0 and 1)
(a)
Plot a histogram of the variable F with 12 intervals (bins)
(a)
Create a legend (assuming 3 data-series have already been plotted) with the series called 'Chips', 'Cheese' and 'Gravy', respectively
(a)
Using the appropriate function, round variable D to 3 significant figures
(a)
How to plot a graph in MATLAB
x : [value ofarray]
y : [value ofarray] plot(x, y)
x : [value ofarray];
y : [value ofarray]; plot(x, y)
x=[value ofarray];
y=[value ofarray]; plot(x, y)
x : [value ofarray]
y : [value ofarray] plot(x, y);
WHAT ARE THE SPECIAL MATRIX IN MATLAB
HILBERT MATRIX
HILBERT INVERSE MATRIX
PASCAL MATRIX
SQUARE MAGIC
TOEPLITZ MATRIX
VANDERMONDE MATRIX
EIGEN VALUE TEST MATRIX
SQUARE MATRIX
SOLVE('4-t^2=0')
(a)
A= 1 2 3
4 5 6
7 8 9
>>A(:,2)=[]
1 3
4 6
7 0
2 3
5 6
8 9
1 3
4 6
7 9
2 3
5 6
8 0
Command is used to save command window text to file
a) saveas
texttofile
diary
todiary
a = 1; sin(a) a = 2;
0.4815
0.8516
0.8415
0.4916
OUTPUT OF A = [0 1; 1 0] ; B=2 ; C = A + B
1 2
4 5
1 4
2 5
ERROR
1 2
5 4
What happens if we don’t assign a variable to an expression which evaluates a numerical value?
MATLAB shows error
values are assigned to a variable ans automatically
Depends on the numerical value
Nothing happens
What is the disadvantage of the whos function in MATLAB?
It does not show the name of the variable
It does not show the class of the variable
It does not show the size of the variable
It does not show the values of the variable
Vectors depend upon brackets while scalars don’t
TRUE
FALSE
OUTPUT OF A=[1 2 3..
];
1 2 3
A row vector concatenated with a null matrix
Error
The output is suppressed
Variables need to have same name while being passed from the primary function to the sub-function
TRUE
FALSE
FIND THE ERROR x=-10:1:10; y=-10:2:10; plot(x,y)
Length of x and y should be same
No error
Plot is not available in MATLAB
Plot x,y has no semicolon
What does the echo command do?
It shows the comments present in Script files
It shows the commands and comments in MAT-files
It echoes
It shows the commands and the comments in M-files
What is the full form for MATLAB
Matrix laboratory
Math laboratory
Matrices lab
Material Lab
Which of the following is not a tool in MATLAB
Command Window
Current Directory
Terminal
Workspace
MATLAB does numerical calculations in double precision, which is
4 & 15 digits
15digits
15 e+001
4 digits
Which of the following ,an expression shouldn't have in MATLAB
manual entry
built entry
built-in functions
user-defined function
Which of the following is not a part of MATLAB
Computation
Object Orientation
Visualization
Programming
Is MATLAB a high performing language for technical computing?
True
False
Find the output :
>>1/(2+3^4 )+4/5*6/7*7/8
0.5506
0.7680
0.8706
0.6680
The two types of prompts in MATLAB
>>> for full version
EDU>>> for educational version
>> for full version
EDU>> for educational version
<<< start>>> for full version
EDU<<<stop>>> for educational version
>> for full version
EDU> for educational version
What is the symbol for division?
\
/
%
^
x = 2;
if x > 2
y = 2*x;
elseif x < 2
y = 3*x;
else
y = 6*x;
end
What is y?
2
4
6
12
vec = [1 6 20 3 2];
[m, n] = max(vec);
What is the value of n?
5
20
3
2
What is the result of
mod(25,6)?
(a)
x = [1 0 0]; y = [0 1 0];
new = 3*sum(x|y)
What is the value of new?
(a)
for index = 1:2:10
v = index*3;
end
How many iterations of the loop will
this code perform?
3
5
6
12
sum([1; 5; 3; 3; 7])
5
7
19
5
x = [1 0 0 1 1]; y = [0 0 0 1 1];
x&y
How many zeros in the resulting
vector?
(a)
a = [2; 5; 3; 6; 4];
What is the result of a(3)?
(a)
function apples = countapples(people, hours)
How many outputs from the above function?
0
1
2
3
fprintf('pi is %6.4f\n', pi)
How many digits will be displayed
after the decimal point?
(a)
mat = [2 1 3; 5 4 6; 7 8 9];
What is in mat(2,1)?
1
2
7
5
If you need to find the cosine of a 30 degree angle you use the code cos(30)
True
False
x = 2;
while x<7
x = x+3;
end
What is stored in x?
(a)
1+2/2*3+5
(a)
x = 1:0.5:3.5;
What is the result of length(x)?
3.5
6
7
100
mat = [1 2 3; 4 5 6];
In which row is the 4 located?
(a)
The workspace is where you type in MATLAB instructions
True
False
What is the default output format for MATLAB?
format bank
format long
format compact
format short
Choose the valid variable name
1Number
oneNum
_one_Number
one-num
Type in the MATLAB code for ln(50)
(a)
All vectors are arrays
True
False
You should use while loops when you know ahead of time how many times the code in the loop should run
True
False
Given a = [6 2 4 1]; and
b = 1×4 logical array
1 0 1 0. What is the result of a(b)?
[2 1]
this does not work
[6]
[6 4]
When a person types information in response to an input statement what is it stored as by default?
a number
a text string
whatever is appropriate
34 25 35;
94 51 75;
40 52 55]
What is the dimension of A ?
34 25 35;
94 51 75;
40 52 55]
How many elements greater than 14 ?
34 25 35;
94 51 75;
40 52 55]
How many elements less than 14 ?
5 < 9
12 < 14
3 ^ 2 * 3 ^ 2
sin(pi/2) + cosd(0)
34 25 35;
94 51 75;
40 52 55]
What is the dimension of A ?
34 25 35;
94 51 75;
40 52 55]
How many elements less than 50 ?
the output line will be ?
34 25 35;
94 51 75;
40 52 55]
How many elements greater than 14 ?
What will print?
4 5 6
6 4 5
nothing
4 6
What will print?
4 5 6
6 5 4
nothing
4 4 4
How many number will print?
5
3
4
0
How many letters will print?
2
1
6
5
Bahasa pemrograman canggih untuk komputasi dibidang keteknikan dalam hal kemampuaanya untuk perhitungan,
visualisasi dan pemrograman komputer.
CD/CAM
MATLAB
LABORATORY
VISUAL BASIC
simbol akar untuk melakukan operasinya yaitu:
sqrt
srtq
qrst
rstq
>>x=[1 2 3];
>>y=[4 5 6]
>>z=x.*y
z=4 10 19
z=4 11 18
z=3 10 18
z=4 10 18
Matlab merupakan singkatan dari...
Mathematic Labour
Mathematic Laboratory
Matrix Laboratory
Matrix Labour
Berikut merupakan contoh penggunaan Matlab, kecuali ...
Matematika dan komputasi
Analisis Psikologi
Analisis numerik dan statistik
Pengembangan aplikasi teknik
Gambar diatas merupakan tampilan dari ...
Command Windows
Command Prompt
Workspace
Current Folder
Bentuk operasi yang benar dalam matlab adalah ...
/ , + , x
/ , - , *
+ , - , :
+ , x , *
Gambar diatas merupakan bagian flowchart yang menyatakan ...
Process
Input/output data
Decision
Terminator
Transpose untuk matrix A adalah ...
Perintah untuk membersihkan layar command windows adalah ...
delete
clear
cls
clc
Perintah untuk menampilkan grafik adalah ...
disp
graph
plot
ploting
This national dish belongs to which country?
Laos
Cambodia
Myanmar
Singapore
This national dish belongs to which country
Philippines
Malaysia
Thailand
Singapore
Which national dish is Lahpet?
Thailand
Myanmar
Malaysia
Indonesia
Which is the national food of the Philippines?
Ambuyat
Lahpet
Adobo
Amok
What is the national food of Brunei Darussalam?
Tom Yam Goong
Ambuyat
Laksa
Gado Gado
What is the national dish of Luang Prabang Salad?
Myanmar
Singapore
Laos
Brunei Darussalam
What is the national dish of Vietnamese Spring Rolls?
Philippines
Thailand
Laos
Vietnam
Which is the national dish of Malaysia?
Nasi Lemak
Luang Prabang Salad
Vietnamese Spring Rolls
Laksa
Which is the national food of Singapore?
Gado Gado
Nasi Lemak
Laksa
Lahpet
Which is the national dish of Indonesia?
Luang Prabang Salad
Gado Gado
Nasi Lemak
Tom Yam Goong
Which flower is the National flower of Laos?
jasmine
frangipani
rose
daffodil
What color do you find on the Lao flag?
blue pink yellow
red and yellow
white blue and red
white and green
What is a true fact about Laos?
Laos is a landlocked country. There is no sea
Laos has no rivers
All Lao people speak Chinese
Laos has no mountains
The money in laos is called....
Lao kip
Baht
Yuan
Ringgit
The population in Laos is about
ten million
five million
seven million
50 million
The most popular local food in laos is...
a hamburger
sticky rice
pizza
durian
The capital city of Laos is...
Paxse
Luang Prabang
Savannakhet
Vientiane
The Lao way of greeting is to say:
Kin kow
Sabaidee
Ola amigo
Ni hao?
Where is Luang Prabang?
south of laos
north of laos
central laos
somewhere over the rainbow
The Mekong river goes through Laos but it starts in...
Vietnam
China
Cambodia
France
(Tom Yam Goong) เป็นอาหารประจำชาติใด
ไทย
จีน
เวียดนาม
พม่า
อาม็อก (Amok) เป็นอาหารประจำชาติใด
อาหารประจำชาติไทย
อาหารประจำชาติกัมพูชา
อาหารประจำชาติเวียนาม
อาหารประจำชาติลาว
อัมบูยัต (Ambuyat) เป็นอาหารประจำชาติ
อาหารประจำชาติอินโดนีเซีย
อาหารประจำชาติของบรูไน
อาหารประจำชาติกัมพูชา
อาหารประจำชาติมาเลเซีย
หล่าเพ็ด (Lahpet)เป็นอาหารประจำชาติใด
อาหารประจำชาติของลาว
อาหารประจำชาติของมาเลเซีย
อาหารประจำชาติของเมียนมา
อาหารประจำชาติของบรูไน
อโดโบ้ (Adobo)เป็นอาหารประจำชาติใด
อาหารประจำชาติของมาเลเซีย
อาหารประจำชาติของสิงค์โปร
อาหารประจำชาติของฟิลิปปินส์
อาหารประจำชาติของฟินแลน์
ลักซา (Laksa)เป็นอาหารประจำชาติใด
อาหารประจำชาติของประเทศสิงคโปร์
อาหารประจำชาติของประเทศไทย
อาหารประจำชาติของประเทศล้านนา
อาหารประจำชาติของประเทศมาเลเซีย
กาโด กาโด (Gado Gado)เป็นอาหารประจำชาติใด
อาหารประจำชาติของสิงค์โปร
อาหารประจำชาติของโปรแลน
อาหารประจำชาติของอินโดนีเซีย
อาหารประจำชาติของอัฟกานิสฐาน
สลัดหลวงพระบาง (Luang Prabang Salad)เป็นชาติใด
อาหารประจำชาติของลาว
อาหารประจำชาติของไทย
อาหารประจำชาติของพม่า
อาหารประจำชาติของกัมพูชา
นาซิ เลอมัก (Nasi Lemak)เป็นอาหารชาติใด
อาหารประจำชาติของประเทศอินโดเนเซีย
อาหารประจำชาติของประเทศสิงค์โปร
อาหารประจำชาติของประเทศมาเลเซีย
อาหารประจำชาติของประเทศกัมพูชา
(Vietnamese Spring Rolls)เป็นอาหารประจำชาติใด
อาหารประจำชาติไทย
อาหารประจำชาติเวียดนาม
อาหารประจำชาติพม่า
อาหารประจำชาติลาว
