Community Profile

photo

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.
That's pretty sad, really.

Statistics

All
  • 6 Month Streak
  • Guiding Light
  • 5-Star Galaxy Level 4
  • Revival Level 3
  • Knowledgeable Level 4
  • Explorer
  • Thankful Level 2
  • First Answer
  • Personal Best Downloads Level 3
  • First Review
  • First Submission

View badges

Content Feed

View by

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

en dag ago | 0

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

3 dagar ago | 0

| accepted

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

4 dagar ago | 0

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

5 dagar ago | 0

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

6 dagar ago | 0

| accepted

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

7 dagar ago | 0

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

7 dagar ago | 1

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

7 dagar ago | 0

| accepted

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

7 dagar ago | 0

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

8 dagar ago | 2

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

8 dagar ago | 0

| accepted

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

9 dagar ago | 1

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

9 dagar ago | 0

| accepted

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

10 dagar ago | 0

| accepted

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

10 dagar ago | 0

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

11 dagar ago | 0

| accepted

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

11 dagar ago | 0

Answered
How to fix "error using class. Not enough input arguments"?
You had probably shadowed the function class() with some variable by the same name -- which is something you should avoid. wh...

11 dagar ago | 0

Answered
How do I insert a variable value in legend of a plot?
There are a bunch of examples around. The sidebar shows some. Here are some others: https://www.mathworks.com/matlabcentral/a...

11 dagar ago | 0

Answered
How to apply Gaussian filter with for loop without imnoise?
Replicating the gaussian noise functionality of imnoise() does not require any loops. If someone insists that you need to use l...

13 dagar ago | 0

| accepted

Answered
how to do Image translation
blef. A = im2double(imread('cameraman.tif')); s = imsize(A,3); % nonstandard; see attached file B = zeros([s 4]); for f = ...

16 dagar ago | 0

Answered
Plot multiple rectangles from set of points
Is this what you mean? C = [1 1; 2 4; 3 2]; % center locations [x y] for c = 1:size(C,1) r = 0.5+rand(1,2)*0.5; pl...

17 dagar ago | 0

| accepted

Answered
How to remove contour line in filled contour plot?
Hmm. I didn't think about that. I don't know that it can be done with contourf(). % make a simple linear ramp that cycles [x...

17 dagar ago | 0

| accepted

Answered
for loop/periodic implementation for number or arrays?
If I'm reading this right... Let's say you have an array A: A = randi([-5 110],5,3) % random test array allowedrange = [1 1...

17 dagar ago | 1

Answered
Using bag of words function
If you just want the word frequency table: filename = 'SampleText.txt'; str = fileread(filename); words = regexp(lower(str),'...

17 dagar ago | 0

Answered
Create Matrix using only zeros and ones
How about an example using concatenation only. No arithmetic composition or array indexing. e = ones(2); c = zeros(3,2); n =...

17 dagar ago | 0

Answered
How to read and scan a text file
Attached is an example file: inputfile = fileread('SampleText.txt'); % make sure file exists? Number_of_vowels = vowelcounts...

18 dagar ago | 1

| accepted

Answered
need help to plot function contain condition 'equal '
There are some problems here. Let's start with the solution. I adjusted the parameters so it looks more like the picture, but ...

18 dagar ago | 0

| accepted

Answered
making a folded picture
If you want to edge-concatenate two images of the same height, you don't need to waste your time with imfuse. s = [s j]; If th...

18 dagar ago | 0

Answered
How display different blocks of the images in one figure?
If you want them tiled as shown, then you're going to have to reassemble them into one image. A = imread('cameraman.tif'); %...

18 dagar ago | 0

Load more