답변 있음
Why don't you draw the line of vectors on the graph?
I think this is because you are plotting inside your while loop. Here you are telling it to plot one data point each time and so...

대략 6년 전 | 0

| 수락됨

답변 있음
How can I use one matrix to assign values to a second matrix using a for loop?
Based on your definition there is nothing to diffuse. If the values is the same all along your domain then there won't be any ch...

대략 6년 전 | 1

| 수락됨

답변 있음
Find zeros of numeric function
You could use fzero for this. Only issue is that it returns the zero closest to a chosen start point, therefore I've put a loop ...

대략 6년 전 | 0

| 수락됨

답변 있음
Plotting a matrix in a for loop.
You have a couple of options here. One is that you store all of the steps of the Markov chain during the for loop and then plot ...

대략 6년 전 | 0

| 수락됨

답변 있음
change scale for colorbar
Have you tried looking at the below link - seems like that might do what you want https://uk.mathworks.com/matlabcentral/answer...

대략 6년 전 | 0

답변 있음
problem in maximizing figure window in matlab 2016a
If you are using R2018a or after then you can use f = figure; f.WindowState = 'maximized'; to maximise the figure window. To ...

대략 6년 전 | 0

답변 있음
White lines in 2D figure when exporting it
There isn't an accepted answer, but the following question has a lot of potential pointers that might be of use. https://uk.mat...

대략 6년 전 | 0

| 수락됨

문제를 풀었습니다


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

대략 6년 전

문제를 풀었습니다


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

대략 6년 전

문제를 풀었습니다


Test for balanced parentheses
Given the input inStr, give the boolean output out indicating whether all the parentheses are balanced. Examples: * If ...

대략 6년 전

문제를 풀었습니다


Clean the List of Names
Given a list of names in a cell array, remove any duplications that result from different capitalizations of the same string. So...

대략 6년 전

문제를 풀었습니다


Indexed Probability Table
This question was inspired by a Stack Overflow question forwarded to me by Matt Simoneau. Given a vector x, make an indexed pro...

대략 6년 전

답변 있음
Why does my ticks/ticks label not match the colour in my colour bar?
Not sure how to do it programatically but in the figure window you can go to "Edit -> Colormap..." and then move the little arro...

대략 6년 전 | 0

답변 있음
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...

대략 6년 전 | 1

| 수락됨

답변 있음
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...

대략 6년 전 | 1

| 수락됨

답변 있음
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...

대략 6년 전 | 0

답변 있음
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...

대략 6년 전 | 0

문제를 풀었습니다


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.

6년 초과 전

답변 있음
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 ...

6년 초과 전 | 0

문제를 풀었습니다


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

6년 초과 전

문제를 풀었습니다


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

6년 초과 전

답변 있음
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...

6년 초과 전 | 0

답변 있음
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...

6년 초과 전 | 0

답변 있음
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)

6년 초과 전 | 0

| 수락됨

답변 있음
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: ...

6년 초과 전 | 1

답변 있음
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);

6년 초과 전 | 0

문제를 풀었습니다


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

6년 초과 전

문제를 풀었습니다


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

6년 초과 전

문제를 풀었습니다


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

6년 초과 전

문제를 풀었습니다


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

6년 초과 전

더 보기