Réponse apportée
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...

plus de 6 ans il y a | 0

A résolu


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

plus de 6 ans il y a

A résolu


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

plus de 6 ans il y a

A résolu


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

plus de 6 ans il y a

A résolu


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

plus de 6 ans il y a

A résolu


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

plus de 6 ans il y a

A résolu


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

plus de 6 ans il y a

A résolu


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

plus de 6 ans il y a

A résolu


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

plus de 6 ans il y a

A résolu


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

plus de 6 ans il y a

Réponse apportée
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...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 6 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 6 ans il y a | 0

| A accepté

A résolu


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

plus de 6 ans il y a

A résolu


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

plus de 6 ans il y a

A résolu


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

plus de 6 ans il y a

A résolu


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

plus de 6 ans il y a

Réponse apportée
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) ...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 6 ans il y a | 1

Réponse apportée
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...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
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 ...

plus de 6 ans il y a | 0

Réponse apportée
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.

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
Why array of strings are concatenated?
You could just store this in a cell array instead - with one parameter inside each cell

plus de 6 ans il y a | 0

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

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
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;...

plus de 6 ans il y a | 2

| A accepté

Réponse apportée
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...

plus de 6 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 6 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 6 ans il y a | 0

Charger plus