Risolto


DC chopper
Input x is the sampled signal vector, may have both AC and DC components. output vector y should have AC components removed then...

quasi 11 anni fa

Risolto


Alternating sum
Given vector x, calculate the alternating sum y = x(1) - x(2) + x(3) - x(4) + ...

quasi 11 anni fa

Risolto


Find the nearest integer
Given a vector of integers and a real number find the closest integer. EX: >> a = [2 4 5 6 8 10]; >> b = 4.6; >> nea...

quasi 11 anni fa

Risolto


Create a two dimensional zero matrix
You have to create a zero matrix of size (mxn) whose inputs are m and n and the elements of your matrix should be zeros. Exam...

quasi 11 anni fa

Risolto


04 - Scalar Equations 3
Define the variables a, b, and c: <<http://samle.dk/STTBDP/Assignment1_4-a.png>> <<http://samle.dk/STTBDP/Assignment1_4-b....

quasi 11 anni fa

Risolto


N-Cards Problem
You have a deck of _N_ cards numbered in order from 1 to _N_. You discard the top card (card 1) and place the next card (card 2)...

quasi 11 anni fa

Risolto


Fahrenheit to Celsius converter
Convert Fahrenheit to Celsius degrees.

quasi 11 anni fa

Risolto


Negative matrix
Change the sign of all elements in given matrix.

quasi 11 anni fa

Risolto


sum of first 'n' terms
Given n=10, find the sum of first 'n' terms Example: If n=10, then x=1,2,3,4,5,6,7,8,9,10. The sum of these n=10 terms is 55...

quasi 11 anni fa

Risolto


The Tower of Hanoi
In the <http://en.wikipedia.org/wiki/Tower_of_Hanoi Tower of Hanoi problem> with 3 rods (1, 2 & 3), the goal is to move a tower ...

quasi 11 anni fa

Risolto


Sum the Digits of a Number
Given an integer, sum the digits repeatedly until you end up with a single value less than 10. For example, if you add the di...

quasi 11 anni fa

Risolto


07 - Common functions and indexing 6
Create a variable _m_ as a magic square with the size 6 x 6 Magic squares are defined as square matrices, where the sum of a...

quasi 11 anni fa

Risolto


05 - Vector Equations 1
Define the vector _cVec_: <<http://samle.dk/STTBDP/Assignment1_2c.png>> (all the numbers from 5 to -5 in increments of -0....

quasi 11 anni fa

Risposto
how can i create matrix of zeros and ones (randomly) sucj that the maximum sum of each row and coloumn =5
Hi, this is a lazy way to do it but it's random and it works : mat=eye(5); mat=repmat(mat,5,5); mat=mat(randperm(25...

quasi 11 anni fa | 0

Risolto


04 - Scalar Equations 2
Define the variables a and b: <<http://samle.dk/STTBDP/Assignment1_4-a.png>> <<http://samle.dk/STTBDP/Assignment1_4-b.png>...

quasi 11 anni fa

Risolto


Create a vector whose elements depend on the previous element
The idea is to create a vector A whose elements depend on the previous element : *A(i+1) = 2*A(i)+1* *2 Inputs*: - A : The...

quasi 11 anni fa

Risolto


First non-zero element in each column
For a given matrix, calculate the index of the first non-zero element in each column. Assuming a column with all elements zero ...

quasi 11 anni fa

Risolto


Reverse the Words (not letters) of a String
*Description* Change the words of a string such that the words appear in reverse order. You may assume that the string is a n...

quasi 11 anni fa

Risolto


Add two numbers
Add two numbers (For beginners)

quasi 11 anni fa

Risolto


surrounded matrix
With a given matrix A (size m x n) create a matrix B (size m+2 x n+2) so that the matrix A is surrounded by ones: A = [1 2 ...

quasi 11 anni fa

Risolto


Triangle Numbers Below N
This is an offshoot of <http://www.mathworks.com/matlabcentral/cody/problems/5-triangle-numbers Cody Problem 5: Triangle Numbers...

quasi 11 anni fa

Risolto


Unit Matrix
Given n, you should return an n-by-n unit matrix. Example: If input is n=2 then A = [ 1 0 0 1 ] If input ...

quasi 11 anni fa

Risolto


04 - Scalar Equations 1
Define the variable a: <<http://samle.dk/STTBDP/Assignment1_4-a.png>> Use this to calculate x: <<http://samle.dk/STTBD...

quasi 11 anni fa

Risolto


High school cafeteria
Given an input vector of positive integers, return a row vector with the primes first (in increasing order) and the composites n...

quasi 11 anni fa

Risolto


Remainder
Make 'y' equal to the remainder of 27 divided by 5. When x=27 and t=5

quasi 11 anni fa

Risolto


length of a vector
Find twice the length of a given vector.

quasi 11 anni fa

Risolto


Is this matrix orthogonal?
Given a square matrix, a, determine whether it is orthogonal. INPUT: a, a n x n matrix OUTPUT: true or false

quasi 11 anni fa

Risolto


Remove white space from the string
Remove the white spaces (trailing and leading) from the input variable

quasi 11 anni fa

Risolto


Rounding
Round 10.67 and make 'y' equal to that number.

quasi 11 anni fa

Risolto


03 - Matrix Variables 5
Make the following variable: <<http://samle.dk/STTBDP/Assignment1_3e.png>>

quasi 11 anni fa

Carica altro