已解决


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

10 years 前

已解决


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

10 years 前

已解决


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

10 years 前

已解决


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

10 years 前

已回答
plot two vectors simultaneuosly on the same axis?
plot(a) hold plot(b)

10 years 前 | 3

已解决


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

10 years 前

已解决


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

10 years 前

已解决


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.

10 years 前

已解决


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

10 years 前

已解决


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

10 years 前

已回答
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>>

10 years 前 | 0

已解决


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

10 years 前

已解决


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

10 years 前

已解决


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

10 years 前

已解决


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

10 years 前

已解决


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

10 years 前

已解决


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

10 years 前

已解决


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

10 years 前

已解决


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

10 years 前

已解决


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

10 years 前

已解决


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

10 years 前

已解决


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

10 years 前

已回答
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.

10 years 前 | 0

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

10 years 前 | 0

已回答
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]...

10 years 前 | 0

| 已接受

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

10 years 前 | 0

已回答
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]; ...

10 years 前 | 3

| 已接受

已回答
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

10 years 前 | 0

| 已接受

已回答
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,...

10 years 前 | 0

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

10 years 前 | 4

| 已接受

加载更多