0% found this document useful (0 votes)
57 views9 pages

National University: Analysis and Visualization With Vectors and Arrays

This document appears to be an experiment report submitted by a student named Dalluay, Jovan Avery S. to their professor Engr. Raymond Joseph R. Meimban of the Electronics Engineering Department at National University. The report discusses analyzing and visualizing data with vectors and arrays in MATLAB and includes the student's responses to 12 questions related to performing basic data analysis and visualization functions in MATLAB.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views9 pages

National University: Analysis and Visualization With Vectors and Arrays

This document appears to be an experiment report submitted by a student named Dalluay, Jovan Avery S. to their professor Engr. Raymond Joseph R. Meimban of the Electronics Engineering Department at National University. The report discusses analyzing and visualizing data with vectors and arrays in MATLAB and includes the student's responses to 12 questions related to performing basic data analysis and visualization functions in MATLAB.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

NATIONAL UNIVERSITY

551 M.F. Jhocson St. Sampaloc, Manila

College of Engineering
Department of Electronics Engineering

ANALYSIS AND VISUALIZATION


WITH VECTORS AND
ARRAYS

EXPERIMENT NO. 3

Submitted by:

Dalluay, Jovan Avery S.


2018 200090

Submitted to:

Engr. Raymond Joseph R. Meimban


ECE Faculty

March 04, 2020


Date
Question 1:
Listen basic data analysis functions available in MATLAB and find information about each one.
Answer:

max - Largest component.


min - Smallest component.
mean - Average or mean value.
size - Size of array.
median - Median value.
var - Variance.
class - Return class name of object.
Median - Median value.
mode - Mode, or most frequent value in a sample.
Std - Standard deviation.

Question 2:
Present in a table the maximum and the minimum electricity consumption of each countries in the data set
and the year when these occurred. Discuss any observations you can make about the data in your table.
Answer:

Country Maximum Year Minimum Year


Japan 961 2004 521 1980
France 447 2004 236 1980
India 471 2004 98 1980
Indonesia 100 2004 11 1980
Italy 302 2004 163 1981

We can see in the table that the electricity consumption is very high in almost all of the country in the
year 2004 and in the year 1980 the consumption is very low execpt italy that has a delay of 1 year.

Question 3:
Based on the sorted year data of Italian electricity use, what can be said about the electricity consumption of
Italy? Is the same observation can be made to other countries?
Answer:

Based on the data that was gathered the electricity consumption of Italy steadily grow as the year passed.
Question 4:
Find and tabulate the changes in electricity use of all countries in ElectricityUse.mat. State your
observations about the generated data
Answer:

Country Change In
ElectricityUse
Argentina 47
Austrialia 127
Brazil 231
Canada 225
China 1694
France 211
India 373
Indonesia 89
Italy 137
Japan 440
SouthKorea 301
Mexico 128
SaudiArabia 118
SouthAfrica 114
Turkey 98
UnitedKingdom 100
UnitedStates 1622

Question 5: Find out what the available elementary mathematical functions in MATLAB are and what each
one does.
Answer:

Trigonometric.
sin - Sine.
sind - Sine of argument in degrees.
sinh - Hyperbolic sine.
asin - Inverse sine.
asind - Inverse sine, result in degrees.
asinh - Inverse hyperbolic sine.
cos - Cosine.
cosd - Cosine of argument in degrees.
cosh - Hyperbolic cosine.
acos - Inverse cosine.
acosd - Inverse cosine, result in degrees.
acosh - Inverse hyperbolic cosine.
tan - Tangent.
tand - Tangent of argument in degrees.
tanh - Hyperbolic tangent.
atan - Inverse tangent.
atand - Inverse tangent, result in degrees.
atan2 - Four quadrant inverse tangent.
atan2d - Four quadrant inverse tangent, result in degrees.
atanh - Inverse hyperbolic tangent.
sec - Secant.
secd - Secant of argument in degrees.
sech - Hyperbolic secant.
asec - Inverse secant.
asecd - Inverse secant, result in degrees.
asech - Inverse hyperbolic secant.
csc - Cosecant.
cscd - Cosecant of argument in degrees.
csch - Hyperbolic cosecant.
acsc - Inverse cosecant.
acscd - Inverse cosecant, result in degrees.
acsch - Inverse hyperbolic cosecant.
cot - Cotangent.
cotd - Cotangent of argument in degrees.
coth - Hyperbolic cotangent.
acot - Inverse cotangent.
acotd - Inverse cotangent, result in degrees.
acoth - Inverse hyperbolic cotangent.
hypot - Square root of sum of squares.
deg2rad - Convert angles from degrees to radians.
rad2deg - Convert angles from radians to degrees.

Exponential.
exp - Exponential.
expm1 - Compute exp(x)-1 accurately.
log - Natural logarithm.
log1p - Compute log(1+x) accurately.
log10 - Common (base 10) logarithm.
log2 - Base 2 logarithm and dissect floating point number.
pow2 - Base 2 power and scale floating point number.
realpow - Power that will error out on complex result.
reallog - Natural logarithm of real number.
realsqrt - Square root of number greater than or equal to zero.
sqrt - Square root.
nthroot - Real n-th root of real numbers.
nextpow2 - Next higher power of 2.
Complex.
abs - Absolute value.
angle - Phase angle.
complex - Construct complex data from real and imaginary parts.
conj - Complex conjugate.
imag - Complex imaginary part.
real - Complex real part.
unwrap - Unwrap phase angle.
isreal - True for real array.
cplxpair - Sort numbers into complex conjugate pairs.

Rounding and remainder.


fix - Round towards zero.
floor - Round towards minus infinity.
ceil - Round towards plus infinity.
round - Round towards nearest integer.
mod - Modulus (signed remainder after division).
rem - Remainder after division.
sign - Signum.

Question 6:
Find out about the functions size, length and numel and their usage.
Answer:

Size - Size of array.


D = size(X), for M-by-N matrix X, returns the two-element row vector.
D = [M,N] containing the number of rows and columns in the matrix.
Length - Length of vector.
length(X) returns the length of vector X.
Numel - Number of elements in an array or subscripted array expression.
N = numel(A) returns the number of elements, N, in array A, equivalent to PROD(SIZE(A)).

Question 7: Using these, load the variables saved in gasprices.mat and show how the dimensions,
number of rows, number of columns and the number of elements can be obtained for the variables Year
and Prices.
Answer:

Number of Rows and Columns


size (Year) = 19     1
size (Prices) = 19    10

Number of Elements
numel (Year) = 19
numel (Prices) =190
 
Question 8:
Explain why each of the commands in step 5 above works or does not work.
Answer:

X*Y
X .* Y
X * x NOT WORKING 
x*X
(x .* y) * Y
(y * x) * X
X*y
X/Y
X ./ Y
X ^ y NOT WORKING
X .^ Y
x ./ y'
x' ./ y

The two equation does not work because the dimensions does not match

Question 9:
Interpret the commands YearlyAvg = mean(Prices,2) and YearlyAvg = mean(Prices'). Tell the similarities and
the differences in the results of each.
Answer:

The row of the YearlyAvg = mean(Prices,2) had become columns when the command YearlyAvg = mean(Prices,2)
have been executed.
Question 10:
Plot the data inside the matrix Prices with Year on the horizontal axis. Annotate your graph with the title
Gas Prices per Country, horizontal axis label as Year and vertical axis as Prices in USD. Show
the legend with the cell array Country as the label. Save the figure as PlotMatrix.jpg and copy of this
graph with this report. Write the commands you have used to generate the plot.
Answer:

Question 11:
Save both Figure 1 and Figure 2 windows as JPEG files. Print a copy of these figure windows and attach the
printed copy into this report.
Answer:
Usage through time
5
4.5

4.5
4

3.5

3.5

3
3

2.5
2.5

2 2
01/90 07/92 01/95 07/97 01/00 07/02 01/05 07/07 01/10 2 2.5 3 3.5 4 4.5 5
Question 12:
Save both Figure 1 and Figure 2 windows as JPEG files. Print a copy of these figure windows and attach the
printed copy into this report.
Answer:

Question 13:
Print all the figure windows and attach them into this report.
Answer:

4.5 4.5

4.5
Retail consumption [109kWh/day]

4
Retail consumption [10 9kWh/day]

4
Retail consumption [109 kWh/day]

4
3.5 3.5

3.5
3 3

3
2.5 2.5

2 2.5 2
01/90 07/92 01/95 07/97 01/00 07/02 01/05 07/07 01/10 01/90 07/92 01/95 07/97 01/00 07/02 01/05 07/07 01/10
Date Date

2
01/90 07/92 01/95 07/97 01/00 07/02 01/05 07/07 01/10
Date
Question 14: Print the plot, and attach the printed copy into this report.
Answer:

5
Data
Modeled trend
4.5
Retail consumption [109 kWh/day]

3.5

2.5

2
07/92 01/95 07/97 01/00 07/02 01/05 07/07
Date

Conclusions and Recommendations:


Answer:

In this experiment we learn more about mathematical and statistic calculations with vectors and matrices
and, we know how to present methods on creating basic visualizations with vectors and matrices. And, this
MATLAB can interpret signals ang signal processing systems, we learn and understand some function in
MATLAB.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy