문제를 풀었습니다


Removing rows from a matrix is easy - but what about inserting rows?
Assume A is a 5-by-5 matrix. A([2,4],:) = [] is a quick way to remove rows 2 and 4. Can you find a quick way to insert rows into...

6년 초과 전

문제를 풀었습니다


N-Dimensional Array Slice
Given an N-dimensional array, _A_, an index, _I_, and a dimension, _d_, return the _I_ th elements of _A_ in the _d_ dimension. ...

6년 초과 전

문제를 풀었습니다


Permute diagonal and antidiagonal
Permute diagonal and antidiagonal For example [1 2 3;4 5 6;7 8 9] -> [3 2 1;4 5 6;9 8 7] WITHOUT diag function (and variable n...

6년 초과 전

문제를 풀었습니다


Matrix with different incremental runs
Given a vector of positive integers a = [ 3 2 4 ]; create the matrix where the *i* th column contains the vector *1:a(i)...

6년 초과 전

문제를 풀었습니다


Rotate input square matrix 90 degrees CCW without rot90
Rotate input matrix (which will be square) 90 degrees counter-clockwise without using rot90,flipud,fliplr, or flipdim (or eval)....

6년 초과 전

문제를 풀었습니다


Set some matrix elements to zero
First get the maximum of each *row*, and afterwards set all the other elements to zero. For example, this matrix: 1 2 3 ...

6년 초과 전

문제를 풀었습니다


Make an awesome ramp for a tiny motorcycle stuntman
Okay, given a vector, say v=[1 3 6 9 11], turn it into a matrix 'ramp' like so: m=[1 3 6 9 11; 3 6 9 11 0; 6 9 ...

6년 초과 전

문제를 풀었습니다


surrounded matrix
With a given matrix A (size m x n) create a matrix B (size m+2 x n+2) so that the matrix A is surrounded by ones: A = [1 2 ...

6년 초과 전

문제를 풀었습니다


Reverse the elements of an array
Reverse the order of elements in an array: eg: input X = [ 1 2 3 ; 4 5 6 ; 7 8 9 ] o...

6년 초과 전

문제를 풀었습니다


Flip the main diagonal of a matrix
Given a n x n matrix, M, flip its main diagonal. Example: >> M=magic(5); >> flipDiagonal(M) 9 24 1 ...

6년 초과 전

문제를 풀었습니다


Back to basics 23 - Triangular matrix
Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, return a matrix with all elements above a...

6년 초과 전

문제를 풀었습니다


Remove NaN ?
input -> matrix (n*m) with at least one element equal to NaN; output -> matrix(p*m), the same matrix where we deleted the enti...

6년 초과 전

문제를 풀었습니다


Back to basics 21 - Matrix replicating
Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, generate an output matrix that consists o...

6년 초과 전

답변 있음
How to align two different sets of data whilst allowing a +- 10% range?
Hi)) %converting and renaming of variables t=table2array(table1); m=matrix2; %0.1 - range of choosing d=1+0.1*[...

6년 초과 전 | 1

| 수락됨

답변 있음
Find the index of a string is structure
As i understand you right, the field textdata contains cell array with some strings. Let figure that |A| - structure. Then if y...

6년 초과 전 | 1

| 수락됨

답변 있음
How to count continuous non zero elements whilst keeping the date of the first non-zero value
Hi. It's the simplest but not the shortest code for this problem. k=A(1,6)~=0; for i=1:size(A,1) if A(i,6)~=0&...

6년 초과 전 | 1

| 수락됨

답변 있음
GA is not working...Function i have written separately calling in main program but not worked??
There are two version of code which are working but do not converge. First: xdata =[ 1 2 3 4 5 6] ; ydata=(1./(xd...

6년 초과 전 | 0

| 수락됨

답변 있음
How can I put the values that I made in a for and if loop into a vector?
Code improvements: %Range of i for different calculation formulas FirstRange=[1:L_1]; SecondRange=[L_1:L]; %Create...

6년 초과 전 | 0

답변 있음
merging two text files and generate 1000 copies of the new text (or dat) file
You should to read help for <https://www.mathworks.com/help/matlab/ref/sprintf.html sprintf> and <https://www.mathworks.com/help...

6년 초과 전 | 1

| 수락됨

답변 있음
I can't open .fig files .m files nothing
You should to click on the "Browse" button and specify the path to your matlab program file which may be "C:\Program Files\MATL...

6년 초과 전 | 0

| 수락됨

답변 있음
could anyone tell me how to have equal spacing of selected numbers with respect to axis.
You can compress data between 2 and 23 ticks roughly by %before plotting XData(XData>2&XData<23)=(XData(XData>2&XData<23)-...

6년 초과 전 | 0

답변 있음
What does the ω_r represent in the Mechanical System Equation provided in the Permanent Magnet Synchronous Machine
Hello, That is also mechanical speed because that is equation of mechanical speed. Maybe in the full system of equations of S...

6년 초과 전 | 0

질문


Error is occured when I changed version of Matlab
I have a lot of the code which work correctly in the Matlab 2013b but when I tried evaluate it on the machine with Matlab 2016a ...

6년 초과 전 | 답변 수: 1 | 0

1

답변

질문


Does symbolic function inv() evaluated in multithread?
Hello, as noted here <https://www.mathworks.com/matlabcentral/answers/95958-which-matlab-functions-benefit-from-multithreaded...

6년 초과 전 | 답변 수: 1 | 0

1

답변

문제를 풀었습니다


Missing five
Convert decimal numbers to a base-9 notation missing the digit *5* <<http://www.alfnie.com/software/missing5.jpg>> Too man...

거의 7년 전

문제를 풀었습니다


Is this is a Tic Tac Toe X Win?
For the game of <https://en.wikipedia.org/wiki/Tic-tac-toe Tic Tac Toe> we will be storing the state of the game in a matrix M. ...

거의 7년 전

문제를 풀었습니다


Pentagonal Numbers
Your function will receive a lower and upper bound. It should return all pentagonal numbers within that inclusive range in ascen...

거의 7년 전

문제를 풀었습니다


Spot the First Occurrence of 5
This problem series invites you to solve two simple problems related to the integer NUMBER FIVE, in order to celebrate <https://...

거의 7년 전

문제를 풀었습니다


I Plead the Fifth
Write a function to provide a yes or no answer to the input string. However, it must plead the 5th amendment (return an empty st...

거의 7년 전

문제를 풀었습니다


Pernicious Anniversary Problem
Since Cody is 5 years old, it's pernicious. <http://rosettacode.org/wiki/Pernicious_numbers Pernicious number> is an integer whi...

거의 7년 전

더 보기