Risolto

Matlab Basics - Pick out parts of a vector

Consider x a vector of length >= 7 (there are at least 7 elements in the vector, write a script that extracts the 2nd element, a...

quasi 3 anni fa

Risolto

Matlab Basics - Set unwanted parts of a vector to zero

Consider a vector x, of length >= 7, write a script to set elements 2, 5, and 6 to zero. Example x = [1 2 3 4 5 6 7] --> ...

quasi 3 anni fa

Risolto

Matlab Basics II - Free Fall

An object freely falling from rest under gravity covers a distance x given by: x = 1/2 gt^2 write a function that calculat...

quasi 3 anni fa

Risolto

Replace every 3rd element in a vector with 4

x is a vector of undetermined length You are to replace every 3rd element with the number 4, example: x = [11 23 34 43 2 3...

quasi 3 anni fa

Risolto

Matlab Basics - Create a row vector

Write a Matlab script to create a row vector of 10 consecutive numbers x = [1 2 3 4 5 6 7 8 9 10]

quasi 3 anni fa

Risolto

Matlab Basics - Rounding I

Write a script to round x DOWN to the next lowest integer: e.g. x = 2.3 --> x = 2 also: x = 2.7 --> x = 2

quasi 3 anni fa

Risolto

Create a Multiplication table matrix...

Create a product table in this format: P = [ 1 2 3 4 5; 2 4 6 8 10; 3 6 9 12 15; 4 8 12 1...

quasi 3 anni fa

Risolto

Replacing a row

For matrix G=[1 2 3; 4 5 6; 7 8 9] Replace the 2nd row with 8s **remember to create matrix G

quasi 3 anni fa

Risolto

ASCii Code

Using matlab, give the symbol that is associated with ASCii code 122

quasi 3 anni fa

Risolto

All your base are belong to us

Find the base _b_ logarithm of the input decimal number _x_. Express the output as a decimal number. The first argument is the n...

quasi 3 anni fa

Risolto

03 - Matrix Variables 4

Make the following variable: <<http://samle.dk/STTBDP/Assignment1_3d.png>> A 3x4 NaN (Not a Number) matrix (Hint: use ...

quasi 3 anni fa

Risolto

Matrix of almost all zeros, except for main diagonal

Write a program to input an integer n and build a n-by-n matrix with the numbers 1,2,...,n on the main diagonal and zeros elsewh...

quasi 3 anni fa

Risolto

Back to basics 7 - Equal NaNs

Covering some basic topics I haven't seen elsewhere on Cody. Given 2 input variables, output true if they are equal, false ot...

quasi 3 anni fa

Risolto

Matlab Basics II - 3 Dimensional Arrays

Assume x is a 3D array with n pages, representing students in a class, for each student (page in the array, the 3rd dimension), ...

quasi 3 anni fa

Risolto

Matlab Basics - y as a function of x

Write a function to calculate y as a function of x, such that y = 6x^2 + 5x - 2

quasi 3 anni fa

Risolto

Matlab Basics II - squares

Write a function that takes matrix A, and squares each element in the matrix example: A = [1 2 3] output = [1 4 9]

quasi 3 anni fa

Risolto

Matlab Basics II - Max & Index of Max

Write a function that takes a vector x, then returns both the max value in x and its location in the vector for example x ...

quasi 3 anni fa

Risolto

Matlab Basics - Absolute Value

Write a script that returns the absolute value of the elements in x e.g. x = [-1 -2 -3 -4] --> y = [1 2 3 4]

quasi 3 anni fa

Risolto

Matlab Basics II - Velocity of a particle

A particle is moving in space, such that it's velocity is given by: <<http://s30.postimg.org/5rf1xtvj5/cody1.png>> write a...

quasi 3 anni fa

Risolto

Matlab Basics II - Intervals

Write a function that takes an interval from a to b, and divides it into 5 parts example: a = 1, b = 2 output = 1 1.25 ...

quasi 3 anni fa

Risolto

Rounding off numbers to n decimals

Inspired by a mistake in one of the problems I created, I created this problem where you have to round off a floating point numb...

quasi 3 anni fa

Risolto

Matlab Basics - Rounding III

Write a script to round a large number to the nearest 10,000 e.g. x = 12,358,466,243 --> y = 12,358,470,000

quasi 3 anni fa

Risolto

Matlab Basics - Assigning Variables

Assign different types of data to variables: integer, double, and strings Example: A is a double, for example 2.34 B is a...

quasi 3 anni fa

Risolto

Back to basics 3 - Temp Directory

Covering some basic topics I haven't seen elsewhere on Cody. Return a string that is the path to the system's current temp di...

quasi 3 anni fa

Risolto

Find out value of sine given by degree.

Find out value of sine given by degree. If theta=30, it's value must be 0.5.

quasi 3 anni fa

Risolto

What percentage?

Calculate the output c as the percentage of a on b for given a and b.

quasi 3 anni fa

Risolto

Sum the 'edge' values of a matrix

Sum the 'edge' values of an input matrix (the values along the perimeter). Example [1 2 3 4 5 6 7 8 9] Output = ...

quasi 3 anni fa

Risolto

Vector Multiplication

Vector Multiplication of three matrix as shown in test cases.

quasi 3 anni fa

Risolto

Area of a triangle

A triangle is given with base *'b'* ,vertical hight *'h'* . then find it's area.

quasi 3 anni fa