Solved


Return area of square
Side of square=input=a Area=output=b

nästan 5 år ago

Solved


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

nästan 5 år ago

Solved


Vector creation
Create a vector using square brackets going from 1 to the given value x in steps on 1. Hint: use increment.

nästan 5 år ago

Solved


Doubling elements in a vector
Given the vector A, return B in which all numbers in A are doubling. So for: A = [ 1 5 8 ] then B = [ 1 1 5 ...

nästan 5 år ago

Solved


Create a vector
Create a vector from 0 to n by intervals of 2.

nästan 5 år ago

Solved


Flip the vector from right to left
Flip the vector from right to left. Examples x=[1:5], then y=[5 4 3 2 1] x=[1 4 6], then y=[6 4 1]; Request not ...

nästan 5 år ago

Solved


Whether the input is vector?
Given the input x, return 1 if x is vector or else 0.

nästan 5 år ago

Solved


Find max
Find the maximum value of a given vector or matrix.

nästan 5 år ago

Solved


Get the length of a given vector
Given a vector x, the output y should equal the length of x.

nästan 5 år ago

Solved


Inner product of two vectors
Find the inner product of two vectors.

nästan 5 år ago

Solved


Arrange Vector in descending order
If x=[0,3,4,2,1] then y=[4,3,2,1,0]

nästan 5 år ago

Solved


Select every other element of a vector
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...

nästan 5 år 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 ...

nästan 5 år ago

Solved


Generate a vector like 1,2,2,3,3,3,4,4,4,4
Generate a vector like 1,2,2,3,3,3,4,4,4,4 So if n = 3, then return [1 2 2 3 3 3] And if n = 5, then return [1 2 2...

nästan 5 år ago

Solved


Maximum value in a matrix
Find the maximum value in the given matrix. For example, if A = [1 2 3; 4 7 8; 0 9 1]; then the answer is 9.

nästan 5 år ago

Solved


Square
square root of x

nästan 5 år ago

Solved


factorial
calculate x!

nästan 5 år ago

Question


Generate random numbers from a vector
I would like Matlab to give me a number from a given row vector, such as: A=[1 3 5 9 100 150 658 999]; Matlab would either giv...

nästan 5 år ago | 1 answer | 0

1

answer

Question


A question related to subs in ode (symbolic maths toolbox)
I have a line: ode=diff(y,x)==x+y; I want matlab to calculate diff(a,b), given a and b are real numerical values. However, the...

ungefär 5 år ago | 1 answer | 0

1

answer

Question


A problem related to symbolic function.
I know that if a want to check if a variable is a function handle, then I can use isa(fun,'function_handle'). What should I typ...

ungefär 5 år ago | 1 answer | 0

1

answer

Question


I am having problems in anonymous function (y=@(x)(...))
Let me re-word my querry. Let's say there is a square matrix of v=[1 2 3 4 5 6 78 9 10; 11 12 13 14 15 16 17 18 19 20;21 22 23 ...

ungefär 5 år ago | 1 answer | 0

1

answer

Question


I am struggling to use sprint
Hi, I have a problem regarding the use of sprintf. Inside a user-defined function (which I can edit), the output is "A" an...

ungefär 5 år ago | 1 answer | 0

1

answer

Question


Convert number to string problem
I would like to ask if there is a way to output a number, which is stored as a variable, using simple commands, as shown in the ...

mer än 5 år ago | 2 answers | 0

2

answers

Question


An "if-loop" and "for-loop" problem
Please help. I am trying to make a nested for-loop with a if-loop inside as follows: S=0; for i=1:10 for j=(i+1)...

ungefär 6 år ago | 1 answer | 0

1

answer

Question


Problem on code while plotting a graph
I am plotting a graph, with the line: figure; hold on ; ..... title('function'); ..... hold off; But I end...

ungefär 6 år ago | 1 answer | 0

1

answer