Respondida
Loop iteration not working
Consider: x = 1:10 This expression by itself results in x being stored as a vector for y = 1:10 y end y In a loop sta...

casi 5 años hace | 0

| aceptada

Respondida
No output from a for and elseif loop
That should be readlines(). P is a cell array of numeric vectors, so address it accordingly. Any assignment to J overwrites th...

casi 5 años hace | 0

| aceptada

Respondida
Turning an entire script into a function
Try something like this. function [playerwon] = Battleship3(boardsize,numofguess,numships) % playerwon = Battleship3({boards...

casi 5 años hace | 0

Respondida
Taking a string input and transferring it to a integer
Meh. numbands = 4; colornames = {'black','brown','red','orange','yellow','green','blue','violet','gray','white','gold','silv...

casi 5 años hace | 1

| aceptada

Respondida
Cropping images around the center of an image with a particular size
I don't know how you're getting that huge size. EDIT: I know why. I'll mention that at the end. The code will return a 225x22...

casi 5 años hace | 0

| aceptada

Respondida
Remove a "plane" from my 3d plot
You could try to clip off the excess points with NaN and be left with a gap in the surface at the joint, or you could just avoid...

casi 5 años hace | 2

| aceptada

Respondida
Error in array bounds
% ... % this loop has been simplified to the point that it works % for sx = 0.01:5 % s = [sx, 0, 0; % 0, sx, 0...

casi 5 años hace | 0

Respondida
How can I add more colors to semilogy?
The colors which are automatically used when plotting things with no explicitly-defined colors are specified by the axes 'coloro...

casi 5 años hace | 0

Respondida
Sampling pixel intensities according to distance matrix...
Disregarding splitapply() for a moment, the issue of working with non-integers can be avoided by using the histogram tools to bi...

casi 5 años hace | 0

Respondida
I cant edit the textboxes in app designer. how do i fix this?
This might be related: https://www.mathworks.com/support/bugreports/1797911 https://www.mathworks.com/matlabcentral/answers/41...

casi 5 años hace | 2

| aceptada

Respondida
How do I confront the value of a matrix?
I'm not really sure what this is supposed to mean. %(x+y+z):3=value16 What guarantees that the sum of x,y,z is less than 3? ...

casi 5 años hace | 0

| aceptada

Respondida
how to place the rectangle for all the blob
The second loop needs to be inside the first one, otherwise it's only going to plot the bounding boxes for the blobs in the last...

casi 5 años hace | 0

| aceptada

Respondida
cell array to logical
In order to make a logical array of it, you'll have to specify the conditions where the output is true. Consider two examples: ...

casi 5 años hace | 0

Respondida
Displaying objects found with bwconncomp
I never really use bwconncomp, but I guess you could do something like this. % create test image A = imread('coins.png') > 8...

casi 5 años hace | 1

Respondida
Image matrix cell color
Let's say you just want to change one pixel A = imread('peppers.png'); newcolor = [230 50 185]; B = A; B(50,50,:) = newc...

casi 5 años hace | 0

| aceptada

Respondida
Sir i am getting error :function isgray has been removed. Please suggest me which version of matlab i should use.
As Steven notes, there are potential ambiguities with trying to do this. In my opnion, isgray() and isind() make some questiona...

casi 5 años hace | 0

Respondida
What indicate the values in colorbar?
In the first example, it doesn't mean anything. It's not referring to the image as displayed by imshow(), since imshow() is not...

casi 5 años hace | 1

| aceptada

Respondida
How to replace every value with the index of the value to the left of it
There's this: x = [ 2 3 4 5 6 ; 8 9 10 11 12 ] idx = reshape(1:numel(x),size(x)); out = [zeros(size(x,1),1) idx(:,1:end-1)] ...

casi 5 años hace | 0

Respondida
image quadrant one by one and move to next quadrant
This should be a start s = [768 1024]; % generate three masks that can be transformed and combined % to create the desired ...

casi 5 años hace | 0

| aceptada

Respondida
How to draw all three plots on the same graph to get the exact graph given in the image?
I'm not sure if you're just after a working plot, or if you're trying to implement the spline interpolation itself. I'm going t...

casi 5 años hace | 0

| aceptada

Respondida
help with matrix concatenation
I'm just going to post these two examples as an answer. If you want to sample the process at the end of each pass, the struct...

casi 5 años hace | 0

Respondida
How to replace cell and neighbors that are zero in a matrix with nan
If you have IPT, this becomes a simple segmentation problem: A = [0 0 0 1 0 0; 0 0 0 0 1 0; 0 0 0 2 0 0; 1 0 1 3...

casi 5 años hace | 0

Respondida
I have a problem with dimensions of vektor and matrix, i do not know why my f vektor is 11x1, it should be 9x1 to be compatible with my matrix A which is 9x9.
The problem is in how you construct x. This looks to me like a classic fencepost error problem, but it's compounded by the fact...

casi 5 años hace | 0

Respondida
how can I collect all possible combinations of two numbers from a data set in matlab ?
Something like this: A = [1 2 4 8 16 32]; k = 2; B = nchoosek(A,k) C = sum(B,2) Be aware how fast the size of B will incr...

casi 5 años hace | 0

| aceptada

Respondida
If loop matrix creation
"Want the matricies for vector that is created to be seperate." What exactly does that mean? I'm assuming "matrices" means "ve...

casi 5 años hace | 0

Respondida
uigridlayout does not recognize 'fit' as parameter for rowheight
It looks like that was introduced in R2019b https://www.mathworks.com/help/matlab/release-notes.html?rntext=uigridlayout&startr...

casi 5 años hace | 0

| aceptada

Respondida
HOW TO CHANGE BINARY IMAGES TO 3D ARRAY (CONVERT TO 3D DIMENSION)
As per Rik's suggestion: % ... % assuming that your dicom images and binary images have same page geometry numframes = 41; ...

casi 5 años hace | 0

| aceptada

Respondida
How can a plot similar to this one can be done? with squares and dotted lines on each horizontal and vertical direction?
If you know where the vertices are, it should be fairly simple. Consider the very simplified example. x = [0 10 10 0 0]; y = ...

casi 5 años hace | 0

| aceptada

Respondida
Deleting NaN from a large array
Depends on what "extremely large" means. Let's start by assuming it's not too large for this to work. Furthermore, it depends ...

casi 5 años hace | 0

| aceptada

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

casi 5 años hace | 1

| aceptada

Cargar más