Answered
How can i generate 3 random points within a 2x2m grid?
I think you were on the right lines but you need to subtract one from your x and y: x=rand(1,3)*2-1; y=rand(1,3)*2-1; That'll...

6 years ago | 0

Solved


Remove the polynomials that have positive real elements of their roots.
The characteristic equation for a dynamic system is a polynomial whose roots indicate its behavior. If any of the <http://www.ma...

6 years ago

Solved


Renaming a field in a structure array
MATLAB has a <http://www.mathworks.com/help/techdoc/ref/setfield.html setfield> and a <http://www.mathworks.com/help/techdoc/ref...

6 years ago

Solved


DNA N-Gram Distribution
Given a string s and a number n, find the most frequently occurring n-gram in the string, where the n-grams can begin at any poi...

6 years ago

Solved


Pattern matching
Given a matrix, m-by-n, find all the rows that have the same "increase, decrease, or stay same" pattern going across the columns...

6 years ago

Solved


It dseon't mettar waht oedrr the lrettes in a wrod are.
An internet meme from 2003 (read more <http://www.snopes.com/language/apocryph/cambridge.asp here>) asserted that readers are re...

6 years ago

Solved


What is the next step in Conway's Life?
Given a matrix A that represents the state of <http://en.wikipedia.org/wiki/Conway's_Game_of_Life Conway's game of Life> at one ...

6 years ago

Solved


Word Counting and Indexing
You are given a list of strings, each being a list of words divided by spaces. Break the strings into words, then return a maste...

6 years ago

Solved


Find state names that end with the letter A
Given a list of US states, remove all the states that end with the letter A. Example: Input s1 = 'Alabama Montana Nebras...

6 years ago

Solved


Is my wife right? Now with even more wrong husband
Again, as in "Is my wife right?" ( <http://www.mathworks.com/matlabcentral/cody/problems/149-is-my-wife-right> ), answer 'yes' r...

6 years ago

Answered
Collapse contour plots on a single plot
If you just want them all on a single plot then just do: contour(x1,y1,z1) hold on contour(x2,y2,z2) and so on... If you wa...

6 years ago | 0

| accepted

Answered
Unable to predict data well enough
I am far from an expert in this area but I'd guess that you are struggling to get a good preciction because you don't have enoug...

6 years ago | 1

| accepted

Answered
Problem in drawing curves after solving ode equations
I think your issue comes from the y(:,2)-N_0 part of your r_R expression. This is asking to take a number away from a number...

6 years ago | 0

| accepted

Solved


Find the palindrome
Given the string a, find the longest palindromic sub-string b. So when a = 'xkayakyy'; you should return b = 'kayak';

6 years ago

Solved


Kaprekar Steps
6174 is the <http://en.wikipedia.org/wiki/6174_%28number%29 Kaprekar constant>. All natural numbers less than 10,000 (except som...

6 years ago

Solved


Find state names that start with the letter N
Given a list of US states, remove all the states that start with the letter N. If s1 = 'Alabama Montana Nebraska Vermont Ne...

6 years ago

Solved


Find the peak 3n+1 sequence value
A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...

6 years ago

Answered
How to convrt parts of grayscale to RGB
This should do the trick: A = rgb2gray(imread('image.png')); A = cat(3, A, A, A); s=size(A); for i=1:s(1) for j=1:s(2) ...

6 years ago | 0

| accepted

Answered
How can I get rid of neighbour data?
So I will preface this by saying there are probably more efficient ways but as you mentione using a for loop you could begin wit...

6 years ago | 0

| accepted

Answered
how can i sum
You can make a simpler solution by just doing: A(A<0)=0; sum(A') If you want to retain the original A matrix then create a co...

6 years ago | 1

Answered
return many value in function.
You do have c5 in your function line. It currently says: function [c1,c2,c3,c5] = calc_centroid(data) Perhaps, just swapping t...

6 years ago | 0

| accepted

Answered
hold on for double plots in one loop
You just need to move the figure command or you’ll get two new figure windows. This would be something like: figure for ...

6 years ago | 0

Answered
Creating a function that goes through a Matrix and scans for any values lesser than 0 (so -1 for example) ?
For a matrix A A(A<0)=0 will convert all negative values to zeros.

6 years ago | 0

| accepted

Answered
Why array of strings are concatenated?
You could just store this in a cell array instead - with one parameter inside each cell

6 years ago | 0

Answered
Finding the last maximum value in a vector
I think this should do it for you: idx = max(find(A==max(max(A))))

6 years ago | 0

| accepted

Answered
for loop within for loop
I don't know what you want to do inside those for loops so I can't give you full code but the loops you'll want are: for i=1:4;...

6 years ago | 2

| accepted

Answered
Unwanted line connecting last point of current plot to the starting one of the next plot
a = [100e6,120e6,130e6]; %semi major axes of different orbits e = [0.7,0.8,0.9]; %eccentricity of different orbits dtheta = [9...

6 years ago | 1

| accepted

Answered
how to duplicate the values in one matrix create another matrix of specific dimension
Assuming you want the rest of the larger matrix to be zeros, then you could use: s=size(A); B(1:s(1),1:s(2)) = A; This will s...

6 years ago | 0

| accepted

Answered
Acquire data from a cartesian diagram in pdf format
I don't think there is an automatic way to do this, but you could use GRABIT from the File Exchange which will allow you to grab...

6 years ago | 1

| accepted

Answered
Zero a cell matrix with varying number of zeros
I'm not 100% sure I follow, but as I understand you want to take some list of columns and turn all elements in that column to ze...

6 years ago | 0

Load more