Community Profile

# Rik

1,224 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 バッジ

import XLSX FILE and plot it in guide
Now I realize what was the strange thing about your code: they are char arrays instead of function handles. In principle that is...

Rebuild the matrix according to the values of its elements
Edit: Now I think I get it. That is also where your precision remark is coming from. The code below gets the job done with isme...

For loop count question
Initialize count to 0 before your nested loop and do count=count+1; inside the inner loop.

1日 前 | 0

How do I write a Roulette Code?
n_games=100; your_number_pick=34; Red=[1:2:9 12:2:18 19:2:27 30:2:36]; Black=[2:2:10 11:2:17 20:2:28 29:2:35]; roulette_...

3日 前 | 0

"at most" in MATLAB
This code should help: check =[1 4;2 5;3 6]; %i=2;j=3; i=5;j=3; matches_per_col=sum(check==i | check==j,1); if max(matches_...

3日 前 | 1

| 採用済み

how to delete the previous plot obtained using slider in GUIDE
The easiest way to accomplish this is to create the second plot first, using the same positions as the first plot (which will th...

4日 前 | 0

How can i make my code interactive?
You aren't checking if the values are valid. That means you're never changing the value of valid, which results in an endless lo...

4日 前 | 0

| 採用済み

How do I separate a string with hyphen and colon separation within cell
If you know the pattern you can simply use that to edit the FormatSpec: fileID=fopen('RD-180531-160600.txt'); FormatSpec='%4s-...

4日 前 | 0

| 採用済み

Justify text in MATLAB Live Editor
Yes, the buttons to allign text are in the lint:

4日 前 | 0

iam getting error while iam debugging the code in matlab 2019, But it is excuting in matlab 2014 version.... Iwant this in MATLAB 2019 please help me
There are only two relevant lines from your enormous blocks of code (that you didn't format yourself): %initial post: h_16qam=...

4日 前 | 0

| 採用済み

Replace matched values with a cell array keeping unmatched values unchanged
This code should help A = '[0, 40, 50, 60, 80, 100, 140, 160, 200, 300]'; B = '48 43 533 6320 ...

4日 前 | 1

| 採用済み

How to campare index number of a matrix with other
A=[ 9 8 5 4 4 10]; B=[1 1 1 3 3 3 2 2 1 1]; newA=B(A);

4日 前 | 1

How can I multiply axis values by 1000 without changing the data?
You can either multiply the y-values with 1000, or use the YTickLabels: ticks=get(gca,'YTicks');%retrieve current ticks ticks=...

8日 前 | 0

regexp for time - cannot guess it
If you know this format, maybe a regexp isn't the right tool for the job. function s=parse_time(str) c=regexp(str,'\.','split'...

8日 前 | 0

If your file doesn't contain any special characters, you could try fileread (which reads a file as one long char array), then sp...

9日 前 | 2

| 採用済み

Subtraction of 2 matrices of the same dimensions and values, gives large floating point values instead of 0!
Welcome to the world of floating point calculation. Computers store values in binary, which sometimes requires rounding. This ro...

9日 前 | 1

| 採用済み

How to find the local mean of an image?
The fastest way to get a local average is to do a convolution with a flat structuring element: %load example image A=imread(['...

10日 前 | 0

| 採用済み

How to calculate the shortest distance between points and a line?
You can use the point_to_line_distance function.

10日 前 | 0

| 採用済み

Can isstrprop search for 2 properties?
I would convert to double type and use ismember to check if all characters are allowed. Alternatively you could just convert ...

10日 前 | 1

EULER'S METHOD GUI HELP
You are using str2num (which you shouldn't), and you are setting a numeric vector as the string property. You may need to consid...

10日 前 | 1

How do i create checkboxes near each plots in a subplot window ?
You can use uicontrol('Style','checkbox').

11日 前 | 0

| 採用済み

Matching based on working days
You can use the weekday function. You can easily adapt the function below to apply specific shifts. A=datenum({'2019-04-07','20...

11日 前 | 0

| 採用済み

Two differente program to write in the same place
This is just a simple concatenation: function output=xx output=[main transfer]; end function output=main output=rand(19,6);...

12日 前 | 0

help with this 02 questions please
For question 1: link For question 2: you can create a CloseRequestFcn that also closes the secondary app link.

12日 前 | 0

| 採用済み

Memory issue to create 4D array
The amount of data is probably huge, is not pre-allocated and will probably not fit in memory. Have you calculated an estimated ...

12日 前 | 0

Finding pythagoras triples when only c is known
You are quite close. The code below contains some optimization in terms of selection of values to check, and the check is modifi...

12日 前 | 1

how do i read a folder database into matlab
Use uigetdir to ask the user for a folder, then use dir to get the list of files inside that folder, then use a for loop to load...

14日 前 | 0

| 採用済み

if statement not working
What you probably think should happen is in the code below, however, there is a better way. A = [5;5;5;3;3;2]; B = [10;4;10;10...

14日 前 | 1

| 採用済み

How can I change from Cell to Double and writing in many lines
The code below should do what you want. %generate input A=cellfun(@(x) {x+rand(6,6)},num2cell(1:19)'); %convert the cell co...

14日 前 | 0

| 採用済み

Round to Nearest Multiple of 4.
a=45; k=4; b=k*round(a/k);

14日 前 | 1

| 採用済み