A résolu


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...

presque 12 ans il y a

A résolu


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

presque 12 ans il y a

A résolu


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

presque 12 ans il y a

A résolu


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...

presque 12 ans il y a

Réponse apportée
plot two vectors simultaneuosly on the same axis?
plot(a) hold plot(b)

presque 12 ans il y a | 3

A résolu


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

presque 12 ans il y a

A résolu


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 ...

presque 12 ans il y a

A résolu


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.

presque 12 ans il y a

A résolu


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

presque 12 ans il y a

A résolu


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...

presque 12 ans il y a

Réponse apportée
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>>

presque 12 ans il y a | 0

A résolu


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...

presque 12 ans il y a

A résolu


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...

presque 12 ans il y a

A résolu


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

presque 12 ans il y a

A résolu


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

presque 12 ans il y a

A résolu


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 ...

presque 12 ans il y a

A résolu


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

presque 12 ans il y a

A résolu


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

presque 12 ans il y a

A résolu


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 ...

presque 12 ans il y a

A résolu


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...

presque 12 ans il y a

A résolu


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

presque 12 ans il y a

A résolu


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:...

presque 12 ans il y a

Réponse apportée
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.

presque 12 ans il y a | 0

Réponse apportée
Simulink - Warning algebric loop
the feedback connection to sin_cos should be given using an unit delay block to avoid the algebraic loop error

presque 12 ans il y a | 0

Réponse apportée
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]...

presque 12 ans il y a | 0

| A accepté

Réponse apportée
how to delete all the elements from the matrix?
a = [1 2;3 4] to make this matrix empty.then a = [];

presque 12 ans il y a | 0

Réponse apportée
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]; ...

presque 12 ans il y a | 3

| A accepté

Réponse apportée
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

presque 12 ans il y a | 0

| A accepté

Réponse apportée
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,...

presque 12 ans il y a | 0

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

presque 12 ans il y a | 4

| A accepté

Charger plus