回答済み
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...

7年弱 前 | 0

解決済み


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

7年弱 前

解決済み


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

7年弱 前

解決済み


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

7年弱 前

解決済み


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

7年弱 前

解決済み


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

7年弱 前

解決済み


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

7年弱 前

解決済み


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

7年弱 前

解決済み


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

7年弱 前

解決済み


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

7年弱 前

回答済み
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...

7年弱 前 | 0

| 採用済み

回答済み
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...

7年弱 前 | 1

| 採用済み

回答済み
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...

7年弱 前 | 0

| 採用済み

解決済み


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

7年弱 前

解決済み


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

7年弱 前

解決済み


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

7年弱 前

解決済み


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

7年弱 前

回答済み
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) ...

7年弱 前 | 0

| 採用済み

回答済み
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...

7年弱 前 | 0

| 採用済み

回答済み
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...

7年弱 前 | 1

回答済み
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...

7年弱 前 | 0

| 採用済み

回答済み
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 ...

7年弱 前 | 0

回答済み
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.

7年弱 前 | 0

| 採用済み

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

7年弱 前 | 0

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

7年弱 前 | 0

| 採用済み

回答済み
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;...

7年弱 前 | 2

| 採用済み

回答済み
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...

7年弱 前 | 1

| 採用済み

回答済み
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...

7年弱 前 | 0

| 採用済み

回答済み
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...

7年弱 前 | 1

| 採用済み

回答済み
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...

7年弱 前 | 0

さらに読み込む