Illustration of plot function, C/C++ Programming

Assignment Help:

Illustration of Plot function:

To be more common, the script could prompt the user for the time and temperature, instead of just assigning the values. Then, the axis function could be used depending on whatever the values of x and y is, for illustration,

axis([x-2 x+2 y-10 y+10])

In order to plot more than one point, x and y vectors are formed to store the values of the (x,y) points. For illustration, to plot the points

(1,1)

(2,5)

(3,3)

(4,9)

(5,11)

(6,8)

At first an x vector is formed which has the x values (as they range from 1 to 6 in steps of 1, the colon operator can also be used) and then a y vector is formed with the y values. This will generate (in the Command Window) x and y vectors and then plot them as shown in figure:

2402_Illustration of Plot function.png

 

>> x = 1:6;

>> y = [1 5 3 9 11 8];

>> plot(x,y)

Note that the points are plotted with straight lines drawn in between. The axes are also set up according to the data; for illustration, the x values ranges from 1 to 6 and the y values from 1 to 11, and hence, that is how the axes are set up.

Also, note that in this situation the x values are the indices of the y vector (the y vector has 6 values in it, therefore the indices iterate from 1 to 6). Whenever this is the situation, it is not essential to generate the x vector. For illustration,

>> plot(y)

will plot exactly the similar figure without using an x vector.


Related Discussions:- Illustration of plot function

Implement a algorithm to verify if the link list , Implement a Algorithm to...

Implement a Algorithm to verify if the link list is in Ascending order? A: template bool linklist::isAscending() const{ nodeptr ptr = head; while (ptr->_next)

Padovan string, A Padovan string P(n) for a natural number n is defined as:...

A Padovan string P(n) for a natural number n is defined as: P(0) = ‘X’ P(1) = ‘Y’ P(2) = ‘Z’ P(n) = P(n-2) + P(n-3), n>2

Described container class?explain types of container class, A container cla...

A container class is a class which is used to hold objects in external storage and memory. A container class work as a generic holder. A container class contains a predefined behav

Minimum shelves, write a program to find the minimum number of shelves

write a program to find the minimum number of shelves

CarDealership, ABC Car Dealership needs your help to update the ordering sy...

ABC Car Dealership needs your help to update the ordering system. This car dealer is selling four types of vehicles: Sedan, Truck, SUV, and mini Van. And each type of vehicle can h

Minimum shelf, #At a shop of marbles, packs of marbles are prepared. Packet...

#At a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E …….. All packets are kept in a VERTICAL SHELF in random order. Any numbers of packets with the

Why php is sometimes called as embedded scripting language, Why PHP is some...

Why PHP is sometimes called as embedded scripting language? PHP is a high level language that is used to allow users to write and understand it in human readable form and also

Car rental system, Car Rental System This system tracks cars in a rental co...

Car Rental System This system tracks cars in a rental company. Each car has a number (assume its plate number), type (small car, four wheel car), and status (rented, available). T

Program that implements inference given a bayesian network, In this problem...

In this problem, you will write a program that implements two algorithms for performing exact inference given a Bayesian network, namely, enumeration and variable elimination. Your

Expression and their types in cpp, E x p r e s sion and their types: ...

E x p r e s sion and their types: An expression will be in form of mathematical expression with C++ syntax embedded with it. Expressions are of following types which m

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd