Resuelto


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...

más de 6 años hace

Resuelto


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. ...

más de 6 años hace

Resuelto


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...

más de 6 años hace

Resuelto


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)...

más de 6 años hace

Resuelto


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)....

más de 6 años hace

Resuelto


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 ...

más de 6 años hace

Resuelto


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 ...

más de 6 años hace

Resuelto


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 ...

más de 6 años hace

Resuelto


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...

más de 6 años hace

Resuelto


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 ...

más de 6 años hace

Resuelto


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...

más de 6 años hace

Resuelto


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...

más de 6 años hace

Resuelto


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...

más de 6 años hace

Respondida
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*[...

más de 6 años hace | 1

| aceptada

Respondida
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...

más de 6 años hace | 1

| aceptada

Respondida
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&...

más de 6 años hace | 1

| aceptada

Respondida
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...

más de 6 años hace | 0

| aceptada

Respondida
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...

más de 6 años hace | 0

Respondida
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...

más de 6 años hace | 1

| aceptada

Respondida
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...

más de 6 años hace | 0

| aceptada

Respondida
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)-...

más de 6 años hace | 0

Respondida
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...

más de 6 años hace | 0

Pregunta


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 ...

más de 6 años hace | 1 respuesta | 0

1

respuesta

Pregunta


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

más de 6 años hace | 1 respuesta | 0

1

respuesta

Resuelto


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

casi 7 años hace

Resuelto


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. ...

casi 7 años hace

Resuelto


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

casi 7 años hace

Resuelto


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://...

casi 7 años hace

Resuelto


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...

casi 7 años hace

Resuelto


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

casi 7 años hace

Cargar más