Respondida
How to split a function according to their variables?
There's probably a better way, but I never really use symbolic stuff. I'll just throw this out there. I renamed the functions ...

casi 5 años hace | 2

| aceptada

Respondida
Error using mean: Too many input arguments.
I'm not sure how these arrays are shaped or what the contents are, but I'm guessing you can do something like this: mean(vertca...

casi 5 años hace | 0

| aceptada

Respondida
Line of controlled thickness in image
This is one way to draw a line on the image itself. % it's assumed that this is a color image % if it's not, it needs to eit...

casi 5 años hace | 0

| aceptada

Respondida
the code shows the error "the size input must be scalar" .
You're calling rand() with non-integer vector arguments. The arguments to rand() are the array geometry. With this syntax, the...

casi 5 años hace | 1

Respondida
How to avoid overlap two objects in image
You're going to have to blend the sub-images as you combine them together. This is a simplified example of overlaying two copie...

casi 5 años hace | 0

Respondida
how to add half each time in the second column if the matrix is 71*71
Is this what you mean? A = randi(99,10,10); % smaller for example A(5,:) = 1; A(:,2) = 1.5:size(A,1)+0.5; A Note that the t...

casi 5 años hace | 0

Respondida
how to sum all row values in a matrix except the ith row?
There are probably other ways, but here's a way (if I understand the question correctly). A = rand(6,3,6); dnn = 5; % do not n...

casi 5 años hace | 1

| aceptada

Respondida
Hey all newbie to matlab, was wondering what I can do to fix the "for loop" code I have below, I am getting the "array indices must be positive integers." Thanks in advance!
Try this: counter = 0; t = -15:0.2:15; y = zeros(size(t)); for k = 1:numel(t) y(k) = counter; counter = ((t(k)^4)-...

casi 5 años hace | 2

| aceptada

Respondida
Remove whitespace around exported (saved) figure via imwrite
Is there any reason you're not using print(), saveas(), or exportgraphics()? Instead of f=getframe(gcf); imwrite(f.cdata,'te...

casi 5 años hace | 0

Respondida
My function is running fine for small no but not for big no.Can anybody explain?
Consider: a = next_prime(17560) b = next_prime(5346551) function k = next_prime(n) k = n; while true if...

casi 5 años hace | 0

| aceptada

Respondida
How do I save the coordinates that I find freehand
An example: % generate some example test images % you don't need to do any of this inpict = repmat(double(imread('cameraman.t...

casi 5 años hace | 1

| aceptada

Respondida
How can I extract the data from this jpeg file. Any suggestion ?
Depending on what your expectations are, the answer is one of the following: You can't get what you want. You can, but you won...

casi 5 años hace | 1

Respondida
how to store values from loop in vector
Not knowing what exactly you're doing, it's hard to give an exact or potentially simplified answer, but here's an example. p = ...

casi 5 años hace | 1

Respondida
To read a word and indices
Something like this should be a start. fid = fopen('test.txt'); while true linx = fgetl(fid); if ~ischar(linx); br...

casi 5 años hace | 1

| aceptada

Respondida
Why does my code only print straight lines?
Not sure it's exactly how you want it, but there's this. I put them in subplots just for the sake of clarity. You don't need t...

casi 5 años hace | 0

Respondida
Graphing time vs velocity
This is a starting point: % some test parameters a1 = 1; % Train acceleration (m/s^2) a2 = 1; % Train decceleration (m/s^2) ...

casi 5 años hace | 0

Respondida
Cross section or profile at an angle from [X, Y Data]
Consider: % generate test points in a 3-col format as described [xx yy zz] = peaks(100); rmask = (xx.^2 + yy.^2) <= 2.5^2; X...

casi 5 años hace | 0

Respondida
How to save the required output?
Something like this: %Select image folder A A_dir = uigetdir(); %Select image folder B B_dir = uigetdir(); %Identify file...

casi 5 años hace | 1

| aceptada

Respondida
Unable to convert grayscale images into rgb from a folder.
imwrite() needs numeric/logical data as its primary input. You're feeding it a 3D char array of file paths. Read the file, con...

casi 5 años hace | 0

| aceptada

Respondida
Running a forloop to add text in the black pixels only!
Consider: Str = fileread('adapthisteq.m'); % using this in place of a custom text file x = im2uint8(imread('circles.png')); %...

casi 5 años hace | 0

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

casi 5 años hace | 0

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

casi 5 años hace | 0

| aceptada

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

casi 5 años hace | 0

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

casi 5 años hace | 0

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

casi 5 años hace | 0

| aceptada

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

casi 5 años hace | 0

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

casi 5 años hace | 1

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

casi 5 años hace | 1

| aceptada

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

casi 5 años hace | 0

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

casi 5 años hace | 2

Cargar más