문제를 풀었습니다


Similar Triangles - find the height of the tree
Given the height, h1, of a power pole, shorter than a tree, a given distance, x2 away, please find h2, height of the tree. Pleas...

5년 초과 전

문제를 풀었습니다


"Low : High - Low : High - Turn around " -- Create a subindices vector
Let two vectors *lo* and *hi* be given. The job is to create a index vector like so idx = [lo(1):hi(1) lo(2):hi(2) ...]...

5년 초과 전

문제를 풀었습니다


Return unique values without sorting
If the input vector A is [42 1 1], the output value B must be the unique values [42 1] The *values of B are in the s...

5년 초과 전

문제를 풀었습니다


Specific Element Count
Given a vector _v_ and a element _e_, return the number of occurrences of _e_ in _v_. Note: NaNs are equal and there may be n...

5년 초과 전

문제를 풀었습니다


First non-zero element in each column
For a given matrix, calculate the index of the first non-zero element in each column. Assuming a column with all elements zero ...

5년 초과 전

문제를 풀었습니다


Set the array elements whose value is 13 to 0
Input A either an array or a vector (which can be empty) Output B will be the same size as A . All elements of A equal to 13...

5년 초과 전

문제를 풀었습니다


Angle between two vectors
You have two vectors , determine the angle between these two vectors For example: u = [0 0 1]; v = [1 0 0]; The a...

5년 초과 전

문제를 풀었습니다


Right and wrong
Given a vector of lengths [a b c], determines whether a triangle with those sides lengths is a right triangle: <http://en.wikipe...

5년 초과 전

문제를 풀었습니다


Solitaire Cipher
Implement the <http://en.wikipedia.org/wiki/Solitaire_(cipher) solitaire cipher>. Since this is from Wikipedia, I am capturin...

거의 6년 전

답변 있음
Display the input options for functions with multiple input arguments
<https://www.mathworks.com/matlabcentral/answers/338247-how-to-implement-function-hints-in-your-code> I think they did not ...

거의 6년 전 | 1

| 수락됨

답변 있음
how can i plot different curves when both are variables ?
v= 5:2.5:40; m= 191:10:271; for i=1:length(m) KE(i,:) = 0.5*m(i).*v; end plot(m,KE); legend(string(v...

거의 6년 전 | 0

답변 있음
Why there is no space after the equal sign? (fprintf)
fprintf('%s \n',strcat("s"," = ","1000",";")); output s = 1000;

거의 6년 전 | 1

문제를 풀었습니다


How long is the longest prime diagonal?
Stanislaw Ulam once observed that if the counting numbers are <http://en.wikipedia.org/wiki/Ulam_spiral arranged in a spiral>, t...

거의 6년 전

답변 있음
Generating a random matrix with range
May be something crude like this? x = rand(12,2); x(:,1) = 5*x(:,1); x(:,2) = 5+15*x(:,2) rand generates uniformly...

거의 6년 전 | 0

| 수락됨

답변 있음
Why does patch crash matlab?
Is that so, it doesn't crash my system. Attached the code for reference %clear all; close all; clc load('xP.mat')...

거의 6년 전 | 0

| 수락됨

답변 있음
How to make filename that message + date&time using [imwrite function].
filename = strcat(datestr(now,'yyyy-mm-dd HH-MM-SS-FFF'),'.png'); imwrite(red, filename); Solved? Problem was with the ...

거의 6년 전 | 1

| 수락됨

답변 있음
Where can I find the posixtime() function for MacOSX R2018a?
syntax p = posixtime(t) t should be <https://www.mathworks.com/help/matlab/ref/datetime.html datetime> array, not an in...

거의 6년 전 | 0

답변 있음
What part of my code do i change to print my triangle flipped?
n=input('Enter rows for left triangle\n'); for i=1:n for j=1:i x(i,j) = '*'; end end disp(fl...

거의 6년 전 | 0

| 수락됨

답변 있음
V_n=R*T/P
Yo something is wrong with this line. T=285;2;325; or T=285:2:325; The following works for me, Code 1: R=0.086...

거의 6년 전 | 0

| 수락됨

답변 있음
I want to find DFT of a input sequence. I have run the following code but not getting desired output. Is there any mistake? please help.
line 26, Y = abs(xk).^2; you can use the "fft" function in MATLAB, Lines 18-25 can be replaced with xk = fft(x...

거의 6년 전 | 0

| 수락됨

질문


Fir2 alternatives matlab
Right now I am using Fir2 function to generate fir filter that has the same gain and phase response as the given frequency respo...

대략 6년 전 | 답변 수: 1 | 0

1

답변

문제를 풀었습니다


Create a vector whose elements depend on the previous element
The idea is to create a vector A whose elements depend on the previous element : *A(i+1) = 2*A(i)+1* *2 Inputs*: - A : The...

6년 초과 전

문제를 풀었습니다


Change the sign of even index entries of the reversed vector
change the signs of the even index entries of the reversed vector example 1 vec = [4 -1 -2 9] ans = [9 2 -1 -4] example2...

6년 초과 전

문제를 풀었습니다


Do Fast Fourier Transformation
Example Fast Fourier Transformation from vector [2,1]) ans = 3 1

6년 초과 전

문제를 풀었습니다


How many Fibonacci numbers?
Find the number of unique Fibonacci numbers (don't count repeats) in a vector of positive integers. Example: x=[1 2 3 4 5 6 7 ...

6년 초과 전

문제를 풀었습니다


Spot the outlier
All points except for one lie on a line. Which one is the outlier? Example: You are given a list of x-y pairs in a column ...

6년 초과 전

문제를 풀었습니다


Find a subset that divides the vector into equal halves
Given a vector x, return the indices to elements that will sum to exactly half of the sum of all elements. Example: Inpu...

6년 초과 전

문제를 풀었습니다


Find the biggest empty box
You are given a matrix that contains only ones and zeros. Think of the ones as columns in an otherwise empty floor plan. You wan...

6년 초과 전

문제를 풀었습니다


Make a run-length companion vector
Given a vector x, return a vector r that indicates the run length of any value in x. Each element in r shows how many times the ...

6년 초과 전

문제를 풀었습니다


How many trades represent all the profit?
Given a list of results from trades made: [1 3 -4 2 -1 2 3] We can add them up to see this series of trades made a profit ...

6년 초과 전

더 보기