Risolto


Back to basics 12 - Input Arguments
Covering some basic topics I haven't seen elsewhere on Cody. Return a value equal to the number of input arguments to the fun...

oltre 10 anni fa

Risolto


Sum of diagonal of a square matrix
If x = [1 2 4; 3 4 5; 5 6 7] then y should be the sum of the diagonals of the matrix y = 1 + 4 + 7 = 12

oltre 10 anni fa

Risolto


Circle area using pi
Given a circle's radius, compute the circle's area. Use the built-in mathematical constant pi.

oltre 10 anni fa

Risolto


Create times-tables
At one time or another, we all had to memorize boring times tables. 5 times 5 is 25. 5 times 6 is 30. 12 times 12 is way more th...

oltre 10 anni fa

Risposto
plot two vectors simultaneuosly on the same axis?
plot(a) hold plot(b)

oltre 10 anni fa | 3

Risolto


Create a row array using double colon operator
Create a row array from 9 to 1, using the double colon operator.

oltre 10 anni fa

Risolto


Make one big string out of two smaller strings
If you have two small strings, like 'a' and 'b', return them put together like 'ab'. 'a' and 'b' => 'ab' For extra ...

oltre 10 anni fa

Risolto


Sum all integers from 1 to 2^n
Given the number x, y must be the summation of all integers from 1 to 2^x. For instance if x=2 then y must be 1+2+3+4=10.

oltre 10 anni fa

Risolto


Is my wife right?
Regardless of input, output the string 'yes'.

oltre 10 anni fa

Risolto


Back to basics 6 - Column Vector
Covering some basic topics I haven't seen elsewhere on Cody. Given an input vector, output true or false whether it is a colu...

oltre 10 anni fa

Risposto
how to make a masked block to take some values given as parameters in mask window?
please find the attached pic. <</matlabcentral/answers/uploaded_files/10511/mask.png>>

oltre 10 anni fa | 0

Risolto


Finding Perfect Squares
Given a vector of numbers, return true if one of the numbers is a square of one of the other numbers. Otherwise return false. E...

oltre 10 anni fa

Risolto


Simple equation: Annual salary
Given an hourly wage, compute an annual salary by multiplying the wage times 40 and times 50, because salary = wage x 40 hours/w...

oltre 10 anni fa

Risolto


Back to basics - mean of corner elements of a matrix
Calculate the mean of corner elements of a matrix. e.g. a=[1 2 3; 4 5 6; 7 8 9;] Mean = (1+3+7+9)/4 = 5

oltre 10 anni fa

Risolto


Weighted average
Given two lists of numbers, determine the weighted average. Example [1 2 3] and [10 15 20] should result in 33.333...

oltre 10 anni fa

Risolto


Column Removal
Remove the nth column from input matrix A and return the resulting matrix in output B. So if A = [1 2 3; 4 5 6]; and ...

oltre 10 anni fa

Risolto


Add two numbers
Given a and b, return the sum a+b in c.

oltre 10 anni fa

Risolto


Determine if input is odd
Given the input n, return true if n is odd or false if n is even.

oltre 10 anni fa

Risolto


Find the sum of all the numbers of the input vector
Find the sum of all the numbers of the input vector x. Examples: Input x = [1 2 3 5] Output y is 11 Input x ...

oltre 10 anni fa

Risolto


Make the vector [1 2 3 4 5 6 7 8 9 10]
In MATLAB, you create a vector by enclosing the elements in square brackets like so: x = [1 2 3 4] Commas are optional, s...

oltre 10 anni fa

Risolto


Pizza!
Given a circular pizza with radius _z_ and thickness _a_, return the pizza's volume. [ _z_ is first input argument.] Non-scor...

oltre 10 anni fa

Risolto


Times 2 - START HERE
Try out this test problem first. Given the variable x as your input, multiply it by two and put the result in y. Examples:...

oltre 10 anni fa

Risposto
how can I vary the parameters in s-functions
the parameters which has to be varied should be declared as parameters in the function definition of the s function.

oltre 10 anni fa | 0

Risposto
Simulink - Warning algebric loop
the feedback connection to sin_cos should be given using an unit delay block to avoid the algebraic loop error

oltre 10 anni fa | 0

Risposto
Date conversion in a number format
clc str = '03/06/2014 11:39:04.324 PM'; [date,rem] = strtok(str,'/'); [month,rem]= strtok(rem,'/'); [year,rem]...

oltre 10 anni fa | 0

| accettato

Risposto
how to delete all the elements from the matrix?
a = [1 2;3 4] to make this matrix empty.then a = [];

oltre 10 anni fa | 0

Risposto
Matlab says continue entering statements. I don't know what's wrong.
There should be one more 'end' at the last for closing the for loop clc k = [67.25; 205.25; 223.25; 319.25; 325.25]; ...

oltre 10 anni fa | 3

| accettato

Risposto
Can a client-server interface have multiple parameters in Simulink?
yes, a client server interface can have multiple parameter. i dont know the implementation in ascet

oltre 10 anni fa | 0

| accettato

Risposto
Creating two vectors from one.
x = [2 4;3 -8; 1 2; 2 4]; [m,n]=size(x); for i= 1:m-1 a(i,1) = x(i,2)*x(i+1,1); a(i,2) = x(i,1)*x(i+1,...

oltre 10 anni fa | 0

Risposto
Counting how many times a loop loops.
Check the code below. % Input Varibles g = input('guess how many times'); % Calculate Running Sum...

oltre 10 anni fa | 4

| accettato

Carica altro