Solved


Deleting an element in a matrix
For vector Grades=[98 56 78 34 100 88 87], delete the number 78 to get the following matrix Grades=[98 56 34 100 88 87] **re...

12 years ago

Solved


Vectors counting by 2
Create a vector numbers from 7 to 15 in increments of 2

12 years ago

Solved


length of a vector
Find twice the length of a given vector.

12 years ago

Solved


Flipping
Write code that can reverse the vector without using any sort of loop. Example Given the input vector A = [ 1 2 3 4 5...

12 years ago

Solved


Remainder
Make 'y' equal to the remainder of 27 divided by 5. When x=27 and t=5

12 years ago

Solved


Rounding
Round 10.67 and make 'y' equal to that number.

12 years ago

Solved


Calculate the h-index
H-index is a powerful tool for quantifying the scientific contribution of a researcher. H-index is defined as follows (source - ...

12 years ago

Solved


Diagonal of a Spiral Matrix
Write a function that will return same output as diag(spiral(n)). The only exception is that spiral and diag functions are not a...

12 years ago

Solved


Back to the Future III
Marty McFly and Doc Brown are "back" again. See the test suite to see what they are up to.

12 years ago

Solved


Back to the future II
See test suite

12 years ago

Solved


Back to the future
See test suite See also: http://www.mathworks.com/matlabcentral/cody/problems/2449-back-to-the-future-ii

12 years ago

Solved


Magnet and Iron
(Inspired from <http://www.mathworks.com/matlabcentral/cody/problems/112 Problem 112: Remove the air bubbles>) Iron (atomic n...

12 years ago

Solved


Clear functions with the same name in different packages independently
See the test suite. N.B.: Overwriting files or functions a.k.a. cheating is not necessary.

12 years ago

Answered
evalin in caller a command that assigns in caller
There is no viable work-around for nested evalins, but your particular example does not really require them. You could for examp...

12 years ago | 0

Answered
Why is drawnow ignoring object ordering during animation?
You may use plot3(x, y, z,...) and text(x, y, z,...) and control the relative front/behind positions of these elements with the ...

12 years ago | 0

Answered
ind2sub doesn't work
You are funny. _ind2sub_ reshapes the _siz_ first argument to match the number of output variables used (in your case a singl...

12 years ago | 1

| accepted

Answered
eig versus svd functions?
SVD is a decomposition for arbitrary-size matrices, while EIG applies only to square matrices. They are very much related: Th...

12 years ago | 2

| accepted

Answered
How can i create a vector with specific values at different positions?
close enough: v([3:7 10:14 16:18 20:25]) = 1;

12 years ago | 1

| accepted

Answered
Efficient matri x calculation
data_new = ids(data);

12 years ago | 1

Answered
scatter plotting color coded
perhaps something along these lines: % your data (assuming column vectors) lat = convn(randn(1e3,1),hanning(100)); l...

12 years ago | 0

Answered
Splitting a vector into vectors of different length
This is interesting, perhaps something like this would do (this implements a greedy correction of your initial estimate of the d...

12 years ago | 0

| accepted

Answered
picking a random solution to linear equations
I like your _Matlab can do anything_ remark. The _evenly space_ condition is a bit hard to achieve, but here some thoughts anywa...

12 years ago | 1

| accepted

Answered
GUI push button problem
You simply need to add the line: drawnow; to the code running the simulation steps so that Matlab flushes the event queue...

12 years ago | 2

| accepted

Answered
regexp and string rearrange in text file
something along these lines: % reads file into cell array lines = textread('lsit2.txt','%s','delimiter','\n','whitespace...

12 years ago | 0

| accepted

Answered
How to run m-file from another m-file by input string
try this: ... fclose(f); rehash; run(save_name); also make sure that your variable _save_name_ does not include the...

12 years ago | 0

| accepted

Answered
Inserting NaN in particular spots of my matrix, all while "preserving" or shifting all other numbers
If I am interpreting correctly (not really sure if this is what you mean by "shifted down") this should do: c = nan(size(a...

12 years ago | 0

| accepted

Solved


Integer Sequence - II : New Fibonacci
Crack the following Integer Sequence. (Hints : It has been obtained from original Fibonacci Sequence and all the terms are also ...

12 years ago

Solved


Square Diagonal
If n is the given number, then make a diagonal matrix of size 2*2 with the square of that number.

12 years ago

Solved


Find the relation
Take x as input and y as output. If x=1 y=3 If x=2 y=14 If x=3 y=39 If x=4 y=84 Based on this relation find giv...

12 years ago

Solved


Text processing - Help Johnny write a letter home from camp
Johnny overuses the word 'great'. Write a script that will help him with this and future letters. If a sentence contains more ...

12 years ago

Load more