Solved


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

meer dan 10 jaar ago

Solved


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

meer dan 10 jaar ago

Solved


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

meer dan 10 jaar ago

Solved


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

meer dan 10 jaar ago

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

meer dan 10 jaar ago | 3

Solved


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

meer dan 10 jaar ago

Solved


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

meer dan 10 jaar ago

Solved


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.

meer dan 10 jaar ago

Solved


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

meer dan 10 jaar ago

Solved


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

meer dan 10 jaar ago

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

meer dan 10 jaar ago | 0

Solved


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

meer dan 10 jaar ago

Solved


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

meer dan 10 jaar ago

Solved


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

meer dan 10 jaar ago

Solved


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

meer dan 10 jaar ago

Solved


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

meer dan 10 jaar ago

Solved


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

meer dan 10 jaar ago

Solved


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

meer dan 10 jaar ago

Solved


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

meer dan 10 jaar ago

Solved


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

meer dan 10 jaar ago

Solved


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

meer dan 10 jaar ago

Solved


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

meer dan 10 jaar ago

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

meer dan 10 jaar ago | 0

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

meer dan 10 jaar ago | 0

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

meer dan 10 jaar ago | 0

| accepted

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

meer dan 10 jaar ago | 0

Answered
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]; ...

meer dan 10 jaar ago | 3

| accepted

Answered
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

meer dan 10 jaar ago | 0

| accepted

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

meer dan 10 jaar ago | 0

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

meer dan 10 jaar ago | 4

| accepted

Load more