문제를 풀었습니다


Draw 'J'
Given n as input, generate a n-by-n matrix 'J' using 0 and 1 . Example: n=5 ans= [0 0 0 0 1 0 0 0 0 1 0 0 ...

대략 5년 전

문제를 풀었습니다


Draw a 'X'!
Given n as input Draw a 'X' in a n-by-n matrix. example: n=3 y=[1 0 1 0 1 0 1 0 1] n=4 y=[1 0 0...

대략 5년 전

문제를 풀었습니다


Draw 'B'
Draw a x-by-x matrix 'B' using 1 and 0. (x is odd and bigger than 4) Example: x=5 ans= [1 1 1 1 0 1 0 0 0 1 ...

대략 5년 전

답변 있음
log base 10 plot
You're plotting a single value, but you left the default for plot, which is to only show lines, not markers. So your plot looks ...

대략 5년 전 | 0

| 수락됨

답변 있음
nohup matlab - how to pass input to scripts
So actually your question is how to define a char array inside such a call. I suspect you simply need to escape the quotes: noh...

대략 5년 전 | 0

답변 있음
For loop with use of larger than
It sounds like one of the functions related to histcounts is appropriate here. angles=rand(500,1)*2*360-360; pressure=sind(ang...

대략 5년 전 | 1

답변 있음
How to use First button function codes "symbol name" in Second button function in App Designer
Don't use global variables. There are many other ways to share data between callbacks. You should probably store the variable in...

대략 5년 전 | 0

| 수락됨

문제를 풀었습니다


~~~~~~~ WAVE ~~~~~~~~~
|The WAVE generator| Once upon a time there was a river. 'Sum' was passing by the river. He saw the water of the river that w...

대략 5년 전

문제를 풀었습니다


Remove the air bubbles
Given a matrix a, return a matrix b in which all the zeros have "bubbled" to the top. That is, any zeros in a given column shoul...

대략 5년 전

문제를 풀었습니다


Draw 'E'
Draw a x-by-x matrix 'E' using 1 and 0. (x is odd and bigger than 4) Example: x=5 ans= [1 1 1 1 1 1 0 0 0 0 ...

대략 5년 전

문제를 풀었습니다


Piecewise linear interpolation
Given an Mx2 vector and a row of M-1 integers, output a two column vector that linearly interpolates Y times between each succes...

대략 5년 전

문제를 풀었습니다


We love vectorized solutions. Problem 1 : remove the row average.
Given a 2-d matrix, remove the row average from each row. Your solution MUST be vectorized. The solution will be tested for ac...

대략 5년 전

문제를 풀었습니다


intersection of matrices
Given two matrices filled with ones and zeros, determine if they share a common row, column entry. These matrices are of identi...

대략 5년 전

문제를 풀었습니다


Generate N equally spaced intervals between -L and L
Given N and L, return a list of numbers (in ascending order) that divides the interval [-L L] into N equal-length segments. F...

대략 5년 전

문제를 풀었습니다


Create logical matrix with a specific row and column sums
Given two numbers *|n|* and *|s|*, build an |n-by-n| logical matrix (of only zeros and ones), such that both the row sums and th...

대략 5년 전

답변 있음
How to sum different cells of cell array
Something like this should work: data={[1,2,3;4,5,6],[3,24,35;46,58,69]; [10,2,3;24,85,6],[11,22,33;54,15,16]}; data=perm...

대략 5년 전 | 0

답변 있음
How to plot vectors with different lenght
You need to make sure your data matches up. You can either remove the x-values you don't have a y for, or add NaN values for tho...

대략 5년 전 | 1

| 수락됨

답변 있음
How to create a string that depends on user input variables?
You can create this text with sprintf and some minor tweaks: str=sprintf('p(%d)*x^%d +', [1:d;(d-1):-1:0]); str=strrep(str...

대략 5년 전 | 1

답변 있음
Adding numbers in a row vector
You can do it with a for loop, but you should use cumsum instead.

대략 5년 전 | 0

| 수락됨

답변 있음
I keep getting the error "Dimension argument must be a positive integer scalar within indexing range"
The trapz function does not allow an anonymous function as second input. You will need to calculate the y values. f= @(x) 2...

대략 5년 전 | 1

| 수락됨

답변 있음
I want to make a series using max & mins of this Integral and show that the series converges and has the limit pi/2.
Your code already is making a series. You could add the envelope, but the only thing you're missing in my opinion is adding the ...

대략 5년 전 | 0

| 수락됨

문제를 풀었습니다


Return a list sorted by number of consecutive occurrences
Inspired by Problem 38 by Cody Team. Given a vector x, return a vector y of the values in x sorted by the number of CONSECUTIVE...

대략 5년 전

문제를 풀었습니다


Replicate elements in vectors
Replicate each element of a row vector (with NaN) a constant number of times. Examples n=2, A=[1 2 3] -> [1 1 2 2 3 3] ...

대략 5년 전

문제를 풀었습니다


Get the elements of diagonal and antidiagonal for any m-by-n matrix
In the problem <http://www.mathworks.com/matlabcentral/cody/problems/858-permute-diagonal-and-antidiagonal Problem 858. Permute ...

대략 5년 전

문제를 풀었습니다


Getting the indices from a matrice
Getting the indices from a matrice. Inspired by Problem 645. Getting the indices from a vector by the great Doug Hull. Given a...

대략 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년 전

문제를 풀었습니다


Construct an index vector from two input vectors in vectorized fashion
Create an index vector defined by two input vectors, one defining the beginnings of one or more index ranges, and the other defi...

대략 5년 전

답변 있음
create a new 4D Array from 2 others
I think I understand what you mean. The code below will overwrite all values that are not NaN for a given depth, which is equiva...

대략 5년 전 | 0

| 수락됨

답변 있음
Generating a random number from array based on requirements
A=[1,2,3,4]; p=[10 20 30 40]; c=cumsum(p); isAllowed=[3,4]; while true [~,r]=histc(rand(1,1),[0 c/c(end)]); if ism...

대략 5년 전 | 0

답변 있음
Graph window is blank
As most of the operation you perform don't work for most shapes of input data, I'm assuming you're calling this code with scalar...

대략 5년 전 | 0

더 보기