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

oltre 6 anni fa | 0

Risolto


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

oltre 6 anni fa

Risolto


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

oltre 6 anni fa

Risolto


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

oltre 6 anni fa

Risolto


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

oltre 6 anni fa

Risolto


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

oltre 6 anni fa

Risolto


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

oltre 6 anni fa

Risolto


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

oltre 6 anni fa

Risolto


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

oltre 6 anni fa

Risolto


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

oltre 6 anni fa

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

oltre 6 anni fa | 0

| accettato

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

oltre 6 anni fa | 1

| accettato

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

oltre 6 anni fa | 0

| accettato

Risolto


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

oltre 6 anni fa

Risolto


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

oltre 6 anni fa

Risolto


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

oltre 6 anni fa

Risolto


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

oltre 6 anni fa

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

oltre 6 anni fa | 0

| accettato

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

oltre 6 anni fa | 0

| accettato

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

oltre 6 anni fa | 1

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

oltre 6 anni fa | 0

| accettato

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

oltre 6 anni fa | 0

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

oltre 6 anni fa | 0

| accettato

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

oltre 6 anni fa | 0

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

oltre 6 anni fa | 0

| accettato

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

oltre 6 anni fa | 2

| accettato

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

oltre 6 anni fa | 1

| accettato

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

oltre 6 anni fa | 0

| accettato

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

oltre 6 anni fa | 1

| accettato

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

oltre 6 anni fa | 0

Carica altro