Answered
Sine function along inclined z axis
Actually, I think I misinterpreted what you meant by "trough". Let's start over. % surface parameters s = [500 500]; % [col...

5 years ago | 1

| accepted

Answered
How can I remove red rectangles from the image or convert the red rectangle color in the image to white?
You could try to bludgeon the image with a median filter, but that's not going to be too great: A = imread('https://www.mathwor...

5 years ago | 0

Answered
Plot function behave differently when only using line versus only using markers when plotting data with NaN values
Reposted from comments: Without knowing what the data looks like, I imagine that not all values are NaN. Markers will be visib...

5 years ago | 0

| accepted

Answered
how do I do Integration
For a constant function like that, you could just do it geometrically: f = 2; xrange = [0.1 0.5]; s = f*abs(diff(xrange)) ...

5 years ago | 0

| accepted

Answered
Sine function along inclined z axis
Consider the 1-D example: rotangle = 45; x = linspace(0,6*pi,500); y = 2*sin(x); trl = tand(rotangle)*x; % simple metho...

5 years ago | 0

Answered
Mathwork address is required. My apologies if its not Matlab question
This shows the address registered for tax purposes. I do not know if there are other office locations. I suppose that depends ...

5 years ago | 0

| accepted

Answered
is an ellipse-shaped structuring element possible
It's possible, just not with strel(). % build test image testsz = [35 35] A = false(testsz); A(ceil(testsz(1)/2),ceil(test...

5 years ago | 0

| accepted

Answered
Interpolation on a 2d grid for a single point
I suppose if you just want to restrict the process to just the four neighbor points, you could do something like this. I'm sure...

5 years ago | 0

Answered
How can I arrange images of splat over a 2D grid/matrix to form a 2D microstructure image?
Here's a start. I imagine you may want to do other things (e.g. controlling spot size or randomizing it?). I'll leave those ch...

5 years ago | 0

Answered
How to change a 3x3 median filter to 5x5?
Start by simplifying: % 2. Median Filter %READ IMAGE inpict = imread('sadimg.bmp'); %imshow(inpict) %title('IMAGE WITH NOIS...

5 years ago | 0

Answered
Four different outputs keep ending up with the same "answer" when I don't believe they're supposed to.
Something like this: numsteps = 100; numtrials = 10; distances = zeros(numtrials,1); finalpos = zeros(numtrials,2); for j...

5 years ago | 0

| accepted

Answered
Can't work out what I did wrong
There were some parentheses misplaced in the expression for f. That said, the error is still large, but I suppose that's intent...

5 years ago | 0

| accepted

Answered
Need help to seperate the text from the background
Thresholding might be part of it, but it'll take a lot of other work to make the masks into something useful. A = imread('https...

5 years ago | 1

| accepted

Answered
How do I calculate a logarithm of a variable base?
Nowhere in the synopsis for log() does it say that it accepts two arguments. For base 2, you can just use log2() More generall...

5 years ago | 0

Answered
How does imflatfield work?
William's comment is close. Probably close enough to be useful, but not quite exactly the same as what imflatfield() does. A =...

5 years ago | 0

Answered
How can I save a variable from the workspace to use it for another script?
You can save variables to a .mat file and then load the .mat file in the other script. https://www.mathworks.com/help/matlabmob...

5 years ago | 0

| accepted

Answered
How do I create a matrix with specific values?
Something like this: expbasket = randi([-9 9],6,21); % placeholder data rvalue = [-9; -6; -3; 3; 6; 9]; % don't need the whole...

5 years ago | 1

| accepted

Answered
how to copy arrays in a cell?
Just use repmat vel1 = repmat(vel1,[8 1]);

5 years ago | 2

| accepted

Answered
Cannot open file "Dataset\" for reading. You might not have read permission.
Something like this dirname = 'sources'; % or whatever directory you choose % get directory contents allfilenames = dir(dir...

5 years ago | 0

Answered
How to use randperm command with same starting and ending number each time to generate random numbers?
Here's one way. It can probably be simpler than this, but eh. N = 7; startnum = 3; endnum = 6; R = 1:N; R = R((R~=start...

5 years ago | 0

| accepted

Answered
How can I make true false codition?
My understanding is that you're manipulating the mirror array in the DMD and then taking an image. It's not clear why you're re...

5 years ago | 0

| accepted

Answered
Subtracting two regions of interests
I don't know that the ROI objects themselves can be combined. It may be possible to get the vertex list and do some external wo...

5 years ago | 0

| accepted

Answered
Result according to corresponding variables
We're going down a bad road if we're trying to use variable names as variables. If instead of using numbered variables, A1,A2,A3...

5 years ago | 0

| accepted

Answered
Integration and average of the pixel values for an image.
You just mean the global sum and mean? Should the image be normalized? Assuming not: A = imread('cameraman.tif'); % this is u...

5 years ago | 0

| accepted

Answered
how to generate and cover all the possible arrays using two enties
If you mean actual strings instead of chars, then: A = dec2bin(0:15); A(A=='1') = 'H'; A(A=='0') = 'C'; A = string(num2cell(...

5 years ago | 0

| accepted

Answered
How can I create a nested loop without confusing the indeces?
Let's see if I understand the intent... I don't know what z and u are, so I'm just going to use placeholders. N = 10; alpha = ...

5 years ago | 0

Answered
Determine Camber and Thickness of a Airfoil - Given the xy coordinates
This isn't exactly a great way, but I'm more used to abusing image processing tools than polyshape() and such. The mention of V...

5 years ago | 0

Answered
Custom color of a line based on the value of the 3rd parameter
There are a couple ways to do this. Using surf() seems to be the better way in general for lines. x = [1,2,3,4,5,6,7,8,9,10]; ...

5 years ago | 0

| accepted

Answered
How to write a regular expression to extract a vector ([6.300000000000001,0.1,-7.5]) using regexp?
Akira's comment may be very relevant, but since I'm unfamiliar with handling JSON, I'll just throw down a regex kludge as reques...

5 years ago | 0

Answered
I need help on how to make the code for this problem...
If you ask me, this is just another poorly worded assignment. If x is a 100 element linear ramp from 0 to 10, then how is it im...

5 years ago | 0

| accepted

Load more