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

alrededor de 6 años hace | 0

Resuelto


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

alrededor de 6 años hace

Resuelto


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

alrededor de 6 años hace

Resuelto


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

alrededor de 6 años hace

Resuelto


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

alrededor de 6 años hace

Resuelto


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

alrededor de 6 años hace

Resuelto


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

alrededor de 6 años hace

Resuelto


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

alrededor de 6 años hace

Resuelto


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

más de 6 años hace

Resuelto


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

más de 6 años hace

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

más de 6 años hace | 0

| aceptada

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

más de 6 años hace | 1

| aceptada

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

más de 6 años hace | 0

| aceptada

Resuelto


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

más de 6 años hace

Resuelto


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

más de 6 años hace

Resuelto


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

más de 6 años hace

Resuelto


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

más de 6 años hace

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

más de 6 años hace | 0

| aceptada

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

más de 6 años hace | 0

| aceptada

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

más de 6 años hace | 1

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

más de 6 años hace | 0

| aceptada

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

más de 6 años hace | 0

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

más de 6 años hace | 0

| aceptada

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

más de 6 años hace | 0

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

más de 6 años hace | 0

| aceptada

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

más de 6 años hace | 2

| aceptada

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

más de 6 años hace | 1

| aceptada

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

más de 6 años hace | 0

| aceptada

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

más de 6 años hace | 1

| aceptada

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

más de 6 años hace | 0

Cargar más