Community Profile

photo

Rik


Last seen: Today
2,480 2017 年以降の合計貢献数

E-mails with feedback/questions about FEX submissions are welcomed. In general I will post e-mails about Answers on the related page, unless there is good cause not to do so.

連絡する

Rik's バッジ

  • MATLAB Central Treasure Hunt Finisher
  • 36 Month Streak
  • Ace
  • Revival Level 3
  • Cody Challenge Master
  • Introduction to MATLAB Master
  • Speed Demon
  • GitHub Submissions Level 3
  • Personal Best Downloads Level 3
  • Editor's Pick
  • Leader
  • Commenter
  • First Review
  • 5-Star Galaxy Level 4
  • First Submission

すべて表示

貢献した分野
表示方法

回答済み
How to sum different cells of cell array
Something like this should work: data={[1,2,3;4,5,6],[3,24,35;46,58,69]; [10,2,3;24,85,6],[11,22,33;54,15,16]}; data=perm...

27分 前 | 0

回答済み
How to plot vectors with different lenght
You need to make sure your data matches up. You can either remove the x-values you don't have a y for, or add NaN values for tho...

37分 前 | 0

回答済み
How to create a string that depends on user input variables?
You can create this text with sprintf and some minor tweaks: str=sprintf('p(%d)*x^%d +', [1:d;(d-1):-1:0]); str=strrep(str...

2日 前 | 0

回答済み
Adding numbers in a row vector
You can do it with a for loop, but you should use cumsum instead.

2日 前 | 0

| 採用済み

回答済み
I keep getting the error "Dimension argument must be a positive integer scalar within indexing range"
The trapz function does not allow an anonymous function as second input. You will need to calculate the y values. f= @(x) 2...

2日 前 | 0

| 採用済み

回答済み
I want to make a series using max & mins of this Integral and show that the series converges and has the limit pi/2.
Your code already is making a series. You could add the envelope, but the only thing you're missing in my opinion is adding the ...

4日 前 | 0

| 採用済み

解決済み


Return a list sorted by number of consecutive occurrences
Inspired by Problem 38 by Cody Team. Given a vector x, return a vector y of the values in x sorted by the number of CONSECUTIVE...

5日 前

解決済み


Replicate elements in vectors
Replicate each element of a row vector (with NaN) a constant number of times. Examples n=2, A=[1 2 3] -> [1 1 2 2 3 3] ...

5日 前

解決済み


Get the elements of diagonal and antidiagonal for any m-by-n matrix
In the problem <http://www.mathworks.com/matlabcentral/cody/problems/858-permute-diagonal-and-antidiagonal Problem 858. Permute ...

5日 前

解決済み


Getting the indices from a matrice
Getting the indices from a matrice. Inspired by Problem 645. Getting the indices from a vector by the great Doug Hull. Given a...

5日 前

解決済み


Set the array elements whose value is 13 to 0
Input A either an array or a vector (which can be empty) Output B will be the same size as A . All elements of A equal to 13...

5日 前

解決済み


Construct an index vector from two input vectors in vectorized fashion
Create an index vector defined by two input vectors, one defining the beginnings of one or more index ranges, and the other defi...

5日 前

回答済み
create a new 4D Array from 2 others
I think I understand what you mean. The code below will overwrite all values that are not NaN for a given depth, which is equiva...

5日 前 | 0

| 採用済み

回答済み
Generating a random number from array based on requirements
A=[1,2,3,4]; p=[10 20 30 40]; c=cumsum(p); isAllowed=[3,4]; while true [~,r]=histc(rand(1,1),[0 c/c(end)]); if ism...

6日 前 | 0

回答済み
Graph window is blank
As most of the operation you perform don't work for most shapes of input data, I'm assuming you're calling this code with scalar...

6日 前 | 0

回答済み
How to write this for loop as a while
Every for-loop can be re-written to a while-loop. y = 0; k = 1; while k<=999 y = y + k*k; k = k + 4; end

6日 前 | 1

回答済み
Modifying odd/even numbers of a column vector
If you have trouble with Matlab basics you may consider doing the Onramp tutorial (which is provided for free by Mathworks). x ...

6日 前 | 0

| 採用済み

回答済み
Multi Dimension Matrix Elements multiplication
Not completely without loops, but this should be fast enough. You should also be aware that loops can sometimes be the fastest w...

6日 前 | 0

回答済み
How to run function between each row
pairs=nchoosek(1:size(data,1),2); for n=1:size(pairs,1) row_a=data(pairs(n,1),:); row_b=data(pairs(n,2),:); %cal...

6日 前 | 0

回答済み
Single line plot with fixed axis
Every axes object has an XScale property you can set to 'log' to get the desired plot. You can use the normal plotting tools (e....

6日 前 | 1

| 採用済み

回答済み
How to click points in a figure to generate a function/set of data?
I would suggest getpts, although there is an alternative that gives visual feedback: ginput.

7日 前 | 0

回答済み
matrix step shift in each row
This method works without a loop. A =[ 1 2 3 4 5 ]; [X,Y]=ndgrid(1:numel(A)); X=X(end:-1:1,:); ind=mod(...

7日 前 | 0

| 採用済み

回答済み
Nothing will be showing on plot
You are plotting single points, without changing the default (where points are not displayed, only the line connecting them). Yo...

7日 前 | 0

回答済み
How can I calculate the revenue in a FOR loop?
Store the revenue in a vector you index with s. Then use sum to calculate the total.

10日 前 | 0

送信済み


GetWritableFolder
Return a folder with write permission.

11日 前 | ダウンロード 1 件 |

Thumbnail

回答済み
Form a Matrix dependent of iterations
I'm going to assume your question is a homework assignment. That is why I will ignore the requirement of using a while loop, as ...

11日 前 | 0

回答済み
how to save each array's results in dependent blank in GUI program base code?
For general advice and examples for how to create a GUI (and avoid using GUIDE), have look at this thread. Below I show you some...

11日 前 | 0

| 採用済み

回答済み
How to detect certain pixel value in a stick.
Something like this will do it: A=imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/524729/image.png'); ...

11日 前 | 0

| 採用済み

回答済み
Bar graph labels not aligning with index value
You need to set the location of the xticks as well, otherwise Matlab will use the current xticks and use your provided labels in...

11日 前 | 0

Load more