Beantwortet
Call to Extract Contents from Cell Array not Equal to Value in Cell Array
Oof. I didn't expect this. Can you find the tiny change I made here (other than line wrapping)? offY1 = {offsetY1:size(I1,1) ...

fast 5 Jahre vor | 1

Beantwortet
Need help with the code.
Try this. shuffletext2([1 2; 3 4; 5 6], 'orange') function [intext] = shuffletext2(pairs,intext) for p = 1:size(pairs,...

fast 5 Jahre vor | 0

Beantwortet
Custom colorbar with predefined ticks
The answer I gave in your last question addressed this issue in part (at least for linear scales). For an arbitrary scale, you ...

fast 5 Jahre vor | 1

| akzeptiert

Beantwortet
why if elseif statement is not working
It's doing exactly what you're telling it to do. Look at the range of the data. Look at the logical tests you're doing. Case ...

fast 5 Jahre vor | 1

Frage


A better way to do antidiagonal matrix vectorization?
Say I want to reduce a MxN matrix to a column vector, consisting of all antidiagonal vectors. Consider the 5x5 matrix: A = res...

fast 5 Jahre vor | 3 Antworten | 0

3

Antworten

Beantwortet
How do I get for loop to stop creating matrix when it reaches the correct size?
I'm just going to assume the intent is something like this: N = 28; vc = [4 -1 zeros(1,N-2) -1 zeros(1,N^2-N-1)]; vr = [4 -1 ...

fast 5 Jahre vor | 0

Beantwortet
Use for loop with Circshift to generate Pentadiagonal matrix
You ask for a pentadiagonal matrix, but what you describe has only three nonzero diagonals, and they aren't centered on the main...

fast 5 Jahre vor | 1

Beantwortet
Pixelwise brightness adjustment using another image (weights)
This might be of use as an example. The original image has large flat regions of solid color, but the weighted image does not. ...

fast 5 Jahre vor | 0

Beantwortet
What mistake I am making?
Try this m = [ 2 14 28 -7 5 ]; avgpositive7multiples_for(m) function [avg] = avgpositive7multiples_for(m) m = m(m >= ...

fast 5 Jahre vor | 0

Beantwortet
summation of a matrix inside circle
This should work regardless of whether N is odd or even. s = 100; A = ones(s); % test array % build distance map rmax = s/...

fast 5 Jahre vor | 0

| akzeptiert

Beantwortet
Legend with 15 colors
I don't know what your plot type is, but consider the contourf example: % the given colormap cmap = [0.851 0.851 0.851;0.498 1...

fast 5 Jahre vor | 0

Beantwortet
How do I write pdf of random variable?
The PDF for uniform random numbers is just a simple piecewise-constant function. Consider uniform random numbers with a lower b...

fast 5 Jahre vor | 0

Beantwortet
Issues with morphological closing of a binary image?
Did you notice that your thresholded image is inverted? By trying to close the inverted image, you're trying to remove the wron...

fast 5 Jahre vor | 0

| akzeptiert

Beantwortet
Vectorization not working in Matlab - Matrix dimensions do no agree?
It can be simpler than that. % original T = eye(3); vec_1 = [4,5,6]; vec_2 = [7,8,9]; tot = 0; for m=1:3 for n=1:3 ...

fast 5 Jahre vor | 0

Beantwortet
Extract substring in right format
Why include the extra _? str = 'Subject160/VSTMB_160_band_resample/data_22_right_average_210225_1827.mat' EventName = regexp(s...

fast 5 Jahre vor | 0

| akzeptiert

Beantwortet
how can i obtain this?
I'm assuming that you want all 71 columns to be extracted in the same fashion. Consider the example: % 5x5x3 array A = cat(3,...

fast 5 Jahre vor | 0

Beantwortet
Extract X, Y and Z data from contour plot in JPEG format.
This is a routine question, it seems. This is the answer as I see it. https://www.mathworks.com/matlabcentral/answers/146003...

fast 5 Jahre vor | 0

Beantwortet
How to interpolate attached data with the interval of 0.1524?
Something like this: DP = readmatrix('DepthVSpressure.txt'); D_refined = min(DP(:,1)):0.1524:max(DP(:,1)); P_refined = inte...

fast 5 Jahre vor | 0

Beantwortet
For loop each RGB image channel
There are probably more succinct ways, but this is one way. Instead of creating a pile of variables, just put things in an arra...

fast 5 Jahre vor | 1

| akzeptiert

Beantwortet
how to rotate integer vector from right to left and vis versa
Something like this shamount = 1; % amount to shift left (negative to shift right) A = 1:5 % test vector B = circshift(A,[0...

fast 5 Jahre vor | 0

| akzeptiert

Beantwortet
Why is there no line on my plot ?
Use the entire vector instead of the last element. plot(prcp_rad,LSyield);

fast 5 Jahre vor | 0

Frage


Dealing with dead newsreader links on the forum
There are countless comments and answers on the forum which link to old Mathworks newsreader threads. Of course we all know tha...

fast 5 Jahre vor | 0 Antworten | 2

0

Antworten

Beantwortet
How do we upsample a colour image by 0.25 and 0.5 without using imresize() function ???
Direct subscript indexing isn't going to work, since there are no fractional indices in an array. lena_quarterup = lena_q(1:l...

fast 5 Jahre vor | 0

Beantwortet
View individual components of NTSC (Y, I and Q) image
You need to assume some nominal Y and then convert back to RGB. A = imread('YIQ_components.jpg'); % original barn image monta...

fast 5 Jahre vor | 0

Beantwortet
Save and Load a matrix
I don't know why nobody has thrown an answer here, but here goes. The output argument of load() is a struct. You either use ...

fast 5 Jahre vor | 0

Beantwortet
Using a variable to help fill in the legend line on a plot
You can use sprintf() to construct a bit of text from numeric variables or other string/char variables. Then you can use that i...

fast 5 Jahre vor | 0

Beantwortet
how to add a corresponding colorbar with a plot lines
Just flip the colormap. y=1+rand(10,10)*9; col = ones(10,3).*rand(10,1); col = sort(col,'ascend'); plot([1 10],[1 10]); h...

fast 5 Jahre vor | 0

| akzeptiert

Beantwortet
I want to put the numerical values in a 19x2 matrix and ignore the text before the numbers
You can start with textscan() fID = fopen('AER309 Lab 4 - CpData.txt', 'r'); M = textscan(fID, '%f %f','HeaderLines',3) fclos...

fast 5 Jahre vor | 1

| akzeptiert

Beantwortet
When using fspecial my figure/picture just ends up as a blue square?
You're probably starting out with a uint8-scaled image and casting it as double. At that point, you can do whatever you want wi...

fast 5 Jahre vor | 2

Beantwortet
Remove white space from around image
It's never too late for reference answers ... Reading the question, I assume that the intent is to crop the excess padding from...

fast 5 Jahre vor | 1

Mehr laden