質問


I need to be able to input a vector, either as a vector, or as a variable name, to a function.
I need to be able to use a vector as an input to a function, but it can be either in vector form or as a variable name: here c0...

7年以上 前 | 1 件の回答 | 0

1

回答

質問


For some strange reason MATLAB spits out two answers to the following code , pay2 =, and p =. It is ony supposed to produce 1 answer
The following code is spitting out two answers, and it's only supposed to produce one answer, payment. Instead it spits out a...

7年以上 前 | 2 件の回答 | 0

2

回答

質問


How to discover where code ends.
function days = day_diff( M1,D1,M2, D2 ) %DAY_DIFF Summary of this function goes here % Detailed explanation goes he...

7年以上 前 | 1 件の回答 | 0

1

回答

質問


I'm getting two answer from my function, I only want one. How do I fix this?
function payment = fare(miles,age) tot1 =0; tot2=0; tot3=0; if miles <= 1 t...

7年以上 前 | 1 件の回答 | 0

1

回答

質問


My code is producing two answers, but it is only supposed to print one.
my code is producing: payment = fare(1.45,17) pay2 = 11.2500 payment = 1.6900 The code itself is: ...

7年以上 前 | 1 件の回答 | 0

1

回答

回答済み
For some strange reason MATLAB spits out two answers to the following code , pay2 =, and p =. It is ony supposed to produce 1 answer
payment = fare(1.45,17) pay2 = 11.2500 payment = 1.6900

7年以上 前 | 0

質問


Hi, how do I cause the following code to recognize that 92 for q and 92 for v are both passing scores, right now it returns false.
function tf = eligible( v,q ) %ELIGIBLE Summary of this function goes here % Detailed explanation goes here t...

7年以上 前 | 2 件の回答 | 0

2

回答

質問


Need to determine the fraction of a matrix of ones and zeroes that are zeroes
I need to determine the fraction of a matrix of ones and zeroes that are zeroes. My code is: function y = zero_stat(Y) ...

7年以上 前 | 2 件の回答 | 0

2

回答

回答済み
I need to produce a matrix that has one's along the diagonal from the upper right to the lower left
Thanks, but use of diag is explicit;y forbidden.

7年以上 前 | 0

| 採用済み

質問


I need to produce a matrix that has one's along the diagonal from the upper right to the lower left
I need to produce a matrix along a square matrix of size "n" that has one's along the diagonal from the upper right to the lower...

7年以上 前 | 3 件の回答 | 0

3

回答

質問


I'm trying to create a matrix of odd numbers, and I'm having some trouble. Any ideas? Thanks
function orms=odd_rms(nn) lim = (nn * 2)-1; odds = nums(1:2:lim); PROBLEM IS WITH THIS LINE %(1:1:nn) = (odds(1:1:nn)...

7年以上 前 | 1 件の回答 | 0

1

回答

質問


I need to receive one row vector do some math on it and return two row vectors, I'm getting an error regarding parentheses. What's wrong?
function (R1, R2) = light_speed(I) x = size(I); R1[1:1:x] = I[1:1:x]*1.609; R2[1:1:x] = I[1:1:x]/300000; end

7年以上 前 | 2 件の回答 | 0

2

回答

質問


I need to sum the values around the perimeter of a matrix, is there sum function in matlab
I assume there is a sum function and attempt the following code: [x,y] =size(M) Z = M(x:-1:1, y:-1,1);

7年以上 前 | 2 件の回答 | 0

2

回答

質問


How to find even positioned numbers in a vector or matrix.
Hi, if I have a matrix, say, [1 2 3; 4 5 6] and I want the 2,2 position and all even number positions within it, I can write a l...

7年以上 前 | 2 件の回答 | 0

2

回答