Community Profile # DGM

Last seen: Today Active since 2015

Hi, I'm nobody.
I don't belong here, but I have nothing better to do.
Matlab used to be part of my work.
Now it's part of my hobbies.

#### Statistics

All
• • • • • • • • • • • #### Content Feed

View by

My function is running fine for small no but not for big no.Can anybody explain?
Consider: a = next_prime(17560) b = next_prime(5346551) function k = next_prime(n) k = n; while true if...

2 jours ago | 0

| accepted

How do I save the coordinates that I find freehand
An example: % generate some example test images % you don't need to do any of this inpict = repmat(double(imread('cameraman.t...

3 jours ago | 1

| accepted

How can I extract the data from this jpeg file. Any suggestion ?
Depending on what your expectations are, the answer is one of the following: You can't get what you want. You can, but you won...

3 jours ago | 0

how to store values from loop in vector
Not knowing what exactly you're doing, it's hard to give an exact or potentially simplified answer, but here's an example. p = ...

3 jours ago | 1

To read a word and indices
Something like this should be a start. fid = fopen('test.txt'); while true linx = fgetl(fid); if ~ischar(linx); br...

3 jours ago | 1

| accepted

Why does my code only print straight lines?
Not sure it's exactly how you want it, but there's this. I put them in subplots just for the sake of clarity. You don't need t...

4 jours ago | 0

Graphing time vs velocity
This is a starting point: % some test parameters a1 = 1; % Train acceleration (m/s^2) a2 = 1; % Train decceleration (m/s^2) ...

5 jours ago | 0

Cross section or profile at an angle from [X, Y Data]
Consider: % generate test points in a 3-col format as described [xx yy zz] = peaks(100); rmask = (xx.^2 + yy.^2) <= 2.5^2; X...

5 jours ago | 0

How to save the required output?
Something like this: %Select image folder A A_dir = uigetdir(); %Select image folder B B_dir = uigetdir(); %Identify file...

7 jours ago | 1

| accepted

Unable to convert grayscale images into rgb from a folder.
imwrite() needs numeric/logical data as its primary input. You're feeding it a 3D char array of file paths. Read the file, con...

7 jours ago | 0

| accepted

Running a forloop to add text in the black pixels only!
Consider: Str = fileread('adapthisteq.m'); % using this in place of a custom text file x = im2uint8(imread('circles.png')); %...

7 jours ago | 0

Construct a 5 x 10 array that contains zeros. Assign elements at (row, column) (3,5), (2,4) and (1, 9) values of 44. Display the matrix.
Consider an altered example: In a 3x5 array, assign a fixed value to elements (3,3), (2,5), and (1,1) sz = [3 5]; % array size...

12 jours ago | 0

Techniques for blending images that have overlap
This is a simple approach to doing edge-interpolation. This could also be done using interpolation tools in fewer lines, but ri...

13 jours ago | 0

| accepted

No data points appear on the graph when I hit run
When you plot points one at a time, they are rendered as single unconnected points. Since there is no specified marker type, th...

14 jours ago | 0

Changing the limit of for loop give different result
Without knowing where fim comes from, I don't know. I'm going to guess that fim is another image imported the same way as the g...

15 jours ago | 0

Never ending while-loop
There are a few problems. LW(1) will never match variabel, since they're different lengths. The first 3 characters of LW will ...

16 jours ago | 0

| accepted

I am trying to use the "findpeaks" function to find the peak in a set of data.
The documentation for findpeaks explains it better than I could: "The prominence of a peak measures how much the peak stands ou...

17 jours ago | 0

why my matlab didn't plot anything?
Start with something like this: m = 85; g = 9.81; ti0 = 0; tf1 = 9; v0 = -20; h = 1; c1 = 11; dv1 = @(g,c1,v,m) g-c1*v/m...

17 jours ago | 1

New matrix with only the negative numbers of another one
A = [-1 ; -2 ; 6 ; -4 ; 5 ; 10; -22; 4]; B = A(A<0)

17 jours ago | 0

| accepted

How to update title of plot without it "wiggling"
The issue isn't with getting the right number of characters. It's an issue of character spacing. plot(rand(1,10),rand(1,10))...

17 jours ago | 0

Find equal pentagonal and square number
This is a rather brute force method, but it still only takes 1.5ms to find the third match on my dumpster PC. n = 1:10000; p...

18 jours ago | 2

Audio to Image Conversion
What are n and m? Is either greater than 65500? Should it be? I don't know if using factor() this way is really doing what y...

18 jours ago | 0

| accepted

Rescale 8-bit grayscale image
Here's a start: inpict = imread('cameraman.tif'); inrange = [64 126; 127 230]; outrange = [0 120; 151 255]; % you sure you ...

19 jours ago | 1

Create a surface from several 1D plots
Something like this: % so you have a vector for x x = linspace(0,1,10); % and a bunch of vectors for z z1 = x.^1; z2 = x.^2...

19 jours ago | 0

| accepted

Applying a circular mask to an image
There are other posts about how to composite two images (or an image and a flat BG) https://www.mathworks.com/matlabcentral/ans...

20 jours ago | 0

| accepted

Given a matrix of n rows and 2 columns containing the xOy coordinates of n points. Find two points with distance and return the row index of those two points
Consider: n = 10; % number of points d = 7; % distance to match P = 10*rand(n,2); % example point list D = sqrt((P(:,1)-...

20 jours ago | 0

Why didn't I find the same answer?
b and B are not the same. They are conjugate. B=-(-1)^(alpha-1)*(1/s^2)^(alpha); In this case (alpha-1) does not equal 0.7. ...

21 jours ago | 0

| accepted

Index in position 2 exceeds array bounds (must not exceed 1) ?
Nothing in this code guarantees that the size of b and c are identical to the size of a. If they aren't the same size, you will...

21 jours ago | 0