解決済み


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年 前

解決済み


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年 前

解決済み


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

約10年 前

解決済み


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年 前

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

約10年 前 | 3

解決済み


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

約10年 前

解決済み


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年 前

解決済み


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年 前

解決済み


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

約10年 前

解決済み


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年 前

回答済み
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年 前 | 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年 前

解決済み


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年 前

解決済み


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年 前

解決済み


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年 前

解決済み


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年 前

解決済み


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

約10年 前

解決済み


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

約10年 前

解決済み


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年 前

解決済み


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年 前

解決済み


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

約10年 前

解決済み


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年 前

回答済み
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年 前 | 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年 前 | 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年 前 | 0

| 採用済み

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

約10年 前 | 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年 前 | 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年 前 | 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年 前 | 0

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

約10年 前 | 4

| 採用済み

さらに読み込む