Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

using matlab This code sets up the interaction. load datafile density = data (:,2); v1 = data (:,3) v2 = data (:,4) MATLAB is designed

image text in transcribedimage text in transcribedimage text in transcribedusing matlabimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

This code sets up the interaction. load datafile density = data (:,2); v1 = data (:,3) v2 = data (:,4) MATLAB is designed to work naturally with arrays. For example, you can add a scalar value to all the elements of an array. x=[123];y=x+2y=345 TASK Add to each element of and store the result in a variable named You can add any two arrays of the same size. z=x+y TASK Create a vector that is the sum of the vectors and You can multiply or divide all the elements of an array by a scalar. z=2xy=x/3 TASK Create a variable that contains the vector vs divided by You can apply basic statistical functions in MATLAB to a vector to produce a single output. For example, the maximum value of a vector can be determined using the max function. xMax=max(x) TASK Create a variable that contains the maximum of the vector. MATLAB has functions that perform mathematical operations on an entire array of values in a single command. For example, you can find the square root of each element in array x with this syntax. xSqrt=sqrt(x) TASK Using the function, create a variable named that contains the rounded elements of The operator performs matrix multiplication. So, if you use to multiply two equally sized vectors, you get an error message because the inner dimensions do not agree. z=[34][1020] Error using * Incorrect dimensions for matrix multiplication. The. operator performs element-wise multiplication by multiplying the corresponding elements of two equally sized arrays. z=[34][1020]z=3080 TASK Create a variable named that contains the element-wise product of and

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 15th International Conference Dexa 2004 Zaragoza Spain August 30 September 3 2004 Proceedings Lncs 3180

Authors: Fernando Galindo ,Makoto Takizawa ,Roland Traunmuller

2004th Edition

3540229361, 978-3540229360

More Books

Students also viewed these Databases questions