Community Profile

photo

Peter


Purdue University

132 total contributions since 2011

Contact

Peter's Badges

  • 5-Star Galaxy Level 1
  • GitHub Submissions Level 1
  • First Submission
  • Thankful Level 1
  • Knowledgeable Level 2
  • First Answer
  • Commenter
  • Promoter
  • Solver

View details...

Contributions in
View by

Answered
Matlab Plotting with out legend
Check out the textbox() or annotation() commands. Text objects are placed inside the plot, while annotations are placed on the f...

14 days ago | 0

Solved


Read a column of numbers and interpolate missing data
Given an input cell array of strings s, pick out the second column and turn it into a row vector of data. Missing data will be i...

1 year ago

Answered
How do I repeat a character n times?
Because your histogram counts will result in variable length strings of asterisks, you'll need to use cell arrays to store each ...

3 years ago | 0

| accepted

Answered
Cropping greyscale image based on pixel
The quick-n-dirty way that comes to mind is to just use a bitmask: 0 to toss a pixel's value and 1 to keep it. It's a little mem...

3 years ago | 0

| accepted

Answered
Plotting seperate figure in for loop
44 separate figures? Be aware that this many figures can make MATLAB unhappy to the point of Java crashing, particularly on lowe...

3 years ago | 0

| accepted

Answered
Comparing arrays using loop?
You can actually do this in Matlab without needing a for loop. If I'm interpreting your question correctly, you're asking to fin...

3 years ago | 0

| accepted

Answered
Parallel-izing, speeding up simulation
Taking a quick look. There's probably more you can do. 1. Eliminating the anonymous function call on the conditional inside t...

3 years ago | 0

| accepted

Answered
ode45 taking long time to solve
Is ode45 a requirement? I'd guess that your equations are becoming stiff when you add in the heavisides. As a result, ode45 is t...

3 years ago | 0

Answered
Display error message and execute catch
Does the text need to remain red and halt execution? A few ways to go about this. First the catch block will hold the error f...

3 years ago | 11

| accepted

Answered
How to find number of values which are repeating in a column?
Take a look at the histcounts function: [N,edges] = histcounts(X,edges) sorts X into bins with the bin edges specified by the v...

3 years ago | 0

Answered
Problem with 'Patch' graphics in 2014b - Splits in two along diagonal
Has this issue been addressed for 2017a? I see it has acquired a ticket as of last year: <https://www.mathworks.com/support/bugr...

3 years ago | 0

Solved


Connect Four Win Checker
<http://en.wikipedia.org/wiki/Connect_Four Connect Four> is a game where you try to get four pieces in a row. For this problem, ...

3 years ago

Answered
Making movie out of images
It would appear you're giving it a matrix of values to make frames, but MATLAB is looking for indices for each pixel to relate t...

4 years ago | 0

| accepted

Answered
Can anyone tell me what is wrong with this loop? It fails on the second line. I believe the functions are correct bc they work in the command line.
As Ced says, some additional context would be helpful to answer the question completely. You say it works form the command li...

4 years ago | 0

Answered
How to check source code for certain strings? [Base MATLAB] [Cody Courseware]
If you can check the source code on submission, you could use a regex to look for the existence of the nested for loop, identify...

4 years ago | 0

Answered
Vectorization of a for loop
v = 1:length(P)-2; ix = find( ((P(v+1) - P(v)) > 0) & ((P(v+2) - P(v+1)) < 0) ) + 1; B2(ix) = 1;

4 years ago | 0

Answered
Is there an easy way to upload my Matlab GUI interface onto a website?
Nothing that I'm aware of. The MATLAB mobile application (http://www.mathworks.com/mobile/features.html) does not support GUI ap...

4 years ago | 0

Submitted


CompareStructures
Function for comparing the fields in a struct datatype

4 years ago | 2 downloads |

Answered
MATLAB Legend title issue
You need to access the title string property of the legend: There is likely a cleaner method to access this with the new grap...

4 years ago | 0

Solved


Remove the small words from a list of words.
Your job is to tidy up a list of words that appear in a string. The words are separated by one or more spaces. Remove all words ...

4 years ago

Solved


Tic Tac Toe FTW
Given a tic tac toe board: * 1 represents X * 0 represents empty. * -1 represents O It is X's move. If there is an imme...

4 years ago

Solved


How to find the position of an element in a vector without using the find function
Write a function posX=findPosition(x,y) where x is a vector and y is the number that you are searching for. Examples: fin...

4 years ago

Solved


Alphabetize by last name
Given a list of names in a cell array, sort the list by the last name. So if list = {'Barney Google','Snuffy Smith','Dagwood ...

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

4 years ago

Solved


Get the area codes from a list of phone numbers
Given a string of text with phone numbers in it, return a unique'd cell array of strings that are the area codes. s = '508-647...

4 years ago

Solved


Find the two-word state names
Given a list of states, remove all the states that have two-word names. If s1 = 'Alabama Montana North Carolina Vermont N...

4 years ago

Solved


Circle area using pi
Given a circle's radius, compute the circle's area. Use the built-in mathematical constant pi.

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

4 years ago

Solved


Produce a Fibonacci sequence
Construct a diagram that generates the Fibonacci sequence: 1, 1, 2, 3, 5, 8, 13, 21, 34.....up to 377 The Fibonacci sequ...

4 years ago

Solved


Make a low pass filter
Make a first order low pass filter that will filter out the high frequency oscillations for the given input signal. The cut-off ...

4 years ago

Load more