Enviada


Random Integers With a Specified Sum and Range
Generate random integers with specified sum and parameters from various distributions.

más de 4 años hace | 1 descarga |

0.0 / 5
Thumbnail

Respondida
Asking about the rounding numbers. (Problem with rotating image)
I mentioned mapping from output back to input. Here is one crude example. This still uses no interpolation. inpict = imread('...

más de 4 años hace | 0

| aceptada

Respondida
How to convert .hdr image data set to .mat?
You can use multibandread() to read these types of data files. https://www.mathworks.com/help/matlab/ref/multibandread.html ...

más de 4 años hace | 1

| aceptada

Respondida
How can I create a function of my code
This probably covers what you are trying to do. I assume your problem description is as follows: You have a cell array of scal...

más de 4 años hace | 0

| aceptada

Respondida
How can I crop a set of non-binary images automatically depending on the size and position of each image?
If the excess area is a solid color (you mentioned white), then I and ImageAnalyst mention multiple methods in this thread: htt...

más de 4 años hace | 0

| aceptada

Respondida
How to open extension .a00 and .sin image Using Matlab
Like KSSV says, use fread() fid = fopen('YourProjection (1).sin','r'); A = fread(fid,Inf,'*uint16'); fclose(fid); A = resh...

más de 4 años hace | 0

| aceptada

Respondida
Stretch downsampled data to fit on same x axis
There are probably tools to do this in SPT, but I don't see why interpolation won't work. Fs = 2000 t = 500 ar1 = 1:1:Fs*t; ...

más de 4 años hace | 0

| aceptada

Respondida
nearest(100*rand()) does not work
Yeah. The error is because you don't have Fixed-point Toolbox. You can either use Matt's suggestion above, or depending on w...

más de 4 años hace | 1

| aceptada

Respondida
Customize the background color in imagesc
If you're talking about the background of the image, that's determined by the image content and the colormap you're using. Sele...

más de 4 años hace | 0

| aceptada

Respondida
I want to design a Homework Problem Solver
Here's part of a solution: instr = 'Given P = 100 kpa, V = 2 litres, T = 273 K, R = 8.314 Solve for n.'; P = str2double(rege...

más de 4 años hace | 0

Respondida
Elementary matrices in Matlab
(EDIT to fix misread) Here's one way: n = 8; z = zeros(1,n-3); R = toeplitz([0 2 -1 z],[0 -2 1 z])

más de 4 años hace | 2

Respondida
Using if statement for switch
This is a simplified conceptual example of one way. % define a list of valid strings validforcestr = lower(["N" "lb" "oz" "kN"...

más de 4 años hace | 0

Respondida
MATLAB can't read files and run the code. The error says that file doesn't exist
I'm going to take a blind shot and guess that your path doesn't actually have two nested directories of the form ...MatlabCode...

más de 4 años hace | 0

Respondida
I am getting an error 'Index in position 2 is invalid. Array indices must be positive integers or logical values.' please help ? Thanks in advance.
Using round() to generate array indices does not guarantee that the results are within [1 size(A,thisdim)]. In this case, the c...

más de 4 años hace | 0

Respondida
Can I recreate this using commands?
Here's one way using implicit array expansion. L = 4; D = 2; % using a loop o = 0; for i = 1:D for j = 1:D ...

más de 4 años hace | 1

Respondida
How to do these legends/colorbar?
If you're asking how to get that colormap applied to a line plot, then you can use the axes 'colororder' property. If you want ...

más de 4 años hace | 0

Respondida
Divid 3D space into grid of n x n x n
Something like this? This returns three 3D arrays which uniformly increment in steps of 3, from 1 to 10. [xx yy zz] = ndgrid(1...

más de 4 años hace | 0

Pregunta


Using regexprep to clean up MATLAB code formatting
I was trying to put together something to fix operator spacing in a bunch of old .m files. I'm reducing this problem example to...

más de 4 años hace | 0 respuestas | 0

0

respuestas

Respondida
Why can't I generate a sphere with a material?
Set up the lights. [X,Y,Z]= sphere(20); x2 = X.*50; y2 = Y.*50; z2 = Z.*50; h = surf(x2,y2,z2); light('Position',[1 3 2]);...

más de 4 años hace | 0

| aceptada

Respondida
Error using insertText Expected input number 1, I, to be one of these types: uint8, uint16, int16, double, single
The first argument to insertText() is an image array. You aren't providing that. https://www.mathworks.com/help/vision/ref/ins...

más de 4 años hace | 0

Respondida
Why is my 3d plot blank if the vectors are not empty?
The reason why the plot looks like nothing (or just like a tiny speck) is because the plot is a straight line that just happens ...

más de 4 años hace | 0

Respondida
How to calculate an average of each 24 numbers in the same serie.
Assuming you want this to be done blockwise, here's one way: v = 1:20; bkavg = mean(reshape(v,5,[]),1) @Image Analyst has a p...

más de 4 años hace | 0

| aceptada

Respondida
How do I do Edge detection with filling the holes?
edgefr = edge(graybg,'Sobel'); % this is your variable name BWBW = bwareaopen(imfill(edgefr,'holes'),20); % wrong variable name...

más de 4 años hace | 0

Respondida
Textscan issues while from file
I have no idea what this data is, but I'm going to guess that reading every other value into two vectors makes no sense. Since ...

más de 4 años hace | 0

Respondida
Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 15-by-7-by-6.
k_nanopcm and T_nanopcm are the same size (15x7x6). In this assignment, the LHS is a scalar. The RHS is a function of a bunc...

más de 4 años hace | 0

| aceptada

Respondida
Is it possible to eliminate a color range from certain colormap?
Old, I know ... If you want to break the circularity of hsv(), you can do so by doing the interpolation yourself: z = peaks(10...

más de 4 años hace | 0

Respondida
how to sum each element in vector
a = 1:1:10; % you could do it with a loop s = zeros(1,numel(a)); s(1) = a(1); for i = 2:numel(a) s(i) = s(i-1) + ...

más de 4 años hace | 0

Respondida
how can I break up a number into its separate digits
I'm sure I've seen more elegant ways, but off the top of my head, I don't remember. EDIT: ... oh. I'm assuming we're talking a...

más de 4 años hace | 0

| aceptada

Respondida
Generate a numerical series
This is one way: k = -8:-1:-14; v = 10.^k fprintf('%g\n',v.') % for sake of clarity

más de 4 años hace | 1

| aceptada

Respondida
*.* and %s meaning in MATLAB
In an expression like v = 'words'; fprintf('this is a progression of several %s\n',v) %s specifies "string or character vect...

más de 4 años hace | 0

| aceptada

Cargar más