Answered

Adding RAM would it speed up the computations done by Matlab?

Increasing your RAM will only really be beneficial for operations on large matrices. If you are struggling with the speed of a s...

Adding RAM would it speed up the computations done by Matlab?

Increasing your RAM will only really be beneficial for operations on large matrices. If you are struggling with the speed of a s...

9 hours ago | 0

| accepted

Answered

Find element index of one array which is equal to the values from another array

A = [1,1,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,4]; B = [1,1,1,1,1,1,3,3,3,3]; u=unique(B); C=[]; for i=1:numel(u) C=[C find(A...

Find element index of one array which is equal to the values from another array

A = [1,1,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,4]; B = [1,1,1,1,1,1,3,3,3,3]; u=unique(B); C=[]; for i=1:numel(u) C=[C find(A...

10 hours ago | 1

| accepted

Answered

What timestep does my ode15s solver use?

Assuming you call ode15s with [t,y]=ode15s... then you can just use diff(t) which will show you the difference between each of...

What timestep does my ode15s solver use?

Assuming you call ode15s with [t,y]=ode15s... then you can just use diff(t) which will show you the difference between each of...

1 day ago | 0

Answered

Solving a cubic function to get one numeric result?

You aren't going to solve this properly by getting an output of one numerical solution because a cubic equation does actually ha...

Solving a cubic function to get one numeric result?

You aren't going to solve this properly by getting an output of one numerical solution because a cubic equation does actually ha...

3 days ago | 0

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.

4 days ago

Answered

How can I change the title of variables ?

Output=yhat; Unemployment=URhat; Consumption=chat; wage=what; You can always also use: clear vars yhat URhat chat what if ...

How can I change the title of variables ?

Output=yhat; Unemployment=URhat; Consumption=chat; wage=what; You can always also use: clear vars yhat URhat chat what if ...

7 days ago | 0

Solved

The Goldbach Conjecture, Part 2

The <http://en.wikipedia.org/wiki/Goldbach's_conjecture Goldbach conjecture> asserts that every even integer greater than 2 can ...

7 days ago

Solved

Sums with Excluded Digits

Add all the integers from 1 to n in which the digit m does not appear. m will always be a single digit integer from 0 to 9. no...

7 days ago

Answered

overly convoluted elseif condition

function y=gain(x) for jj=1:4 p(jj)=1-jj/128; end if x<=4 y=p(x); else y=1; end end I have assum...

overly convoluted elseif condition

function y=gain(x) for jj=1:4 p(jj)=1-jj/128; end if x<=4 y=p(x); else y=1; end end I have assum...

7 days ago | 0

Answered

Can I run the same Simulink model in different Matlab sessions at the same time? Or would they get mixed up?

I can't specifically answer for Simulink because I've never used it but standard Matlab scripts would be fine with this. I imagi...

Can I run the same Simulink model in different Matlab sessions at the same time? Or would they get mixed up?

I can't specifically answer for Simulink because I've never used it but standard Matlab scripts would be fine with this. I imagi...

7 days ago | 0

Answered

I have an array for y-values and one for x-values, the x-values don't stat from 0, How to plot this?

Assuming that you want these x values to be the ones displayed on the x-axis then it's as simple as: plot(x,y)

I have an array for y-values and one for x-values, the x-values don't stat from 0, How to plot this?

Assuming that you want these x values to be the ones displayed on the x-axis then it's as simple as: plot(x,y)

7 days ago | 0

| accepted

Answered

Making my function run for multiple input values

You could call the function inside a ‘for’ loop. That would enable you to feed in the different input values. For example: ...

Making my function run for multiple input values

You could call the function inside a ‘for’ loop. That would enable you to feed in the different input values. For example: ...

8 days ago | 1

Answered

Count how many numbers are above -1 in matrix

To find the locations of your values you can use idx = find(x>-1); And to get the values you can use val = x(idx);

Count how many numbers are above -1 in matrix

To find the locations of your values you can use idx = find(x>-1); And to get the values you can use val = x(idx);

8 days ago | 0

Solved

Encode Roman Numerals

Create a function taking a non-negative integer as its parameter and returning a string containing the Roman Numeral representat...

8 days ago

Solved

Duplicates

Write a function that accepts a cell array of strings and returns another cell array of strings *with only the duplicates* retai...

8 days ago

Solved

The Goldbach Conjecture

The <http://en.wikipedia.org/wiki/Goldbach's_conjecture Goldbach conjecture> asserts that every even integer greater than 2 can ...

8 days ago

Solved

Counting Sequence

Given a vector x, find the "counting sequence" y. A counting sequence is formed by "counting" the entries in a given sequence...

9 days ago

Answered

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

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

9 days ago | 0

Solved

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

9 days ago

Solved

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

9 days ago

Solved

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

9 days ago

Solved

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

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

10 days ago

Solved

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

10 days ago

Solved

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

10 days ago

Solved

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

10 days ago

Solved

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

10 days ago

Answered

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

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

11 days ago | 0

Answered

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

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

11 days ago | 1

| accepted

Answered

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

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

12 days ago | 0

| accepted