Answered
Changing the position of a plot
data1 = rand(1,20); data2 = rand(1,20); figure() ax1 = subplot(2,1,1); plot(data1) ax2 = subplot(2,1,2) plot(data2); ...

3 years ago | 0

| accepted

Answered
How can I get matlab back to the state it started in
ensure that there are no files in the userpath (or at least no .m .mlx .mdl .slx .p .mex* .mlapp .project files) delete prefdir...

3 years ago | 0

| accepted

Answered
What are the differences between integral and trapz?
integral() accepts a function handle and is adaptive. Given two endpoints, it examines how steep the function is locally and cho...

3 years ago | 2

Answered
Write a Matlab program that converts a string (text) message up to 140 characters long into an encrypted message, and then decrypts the message to return the same string. I dont know where I went wrong, any help?
for I=0:size(A) It is a mistake to use single-parameter size() as a bound for a for loop. When you use size() with only a singl...

3 years ago | 0

Answered
Why is my matrix returning a blank output?
A = [1 2 3; 4 5 6; 7 8 9] c = [2 -2 2] [A; c] You can see that for us, the code does run and produce output. I have to wonde...

3 years ago | 0

| accepted

Answered
I can“t break the main loop with my code on function file
A break statement can only occur inside a for or while loop. When it is encountered, it causes the termination only of the inner...

3 years ago | 1

| accepted

Answered
Custom Matrix Interpolation for every 10 numbers in each column
[Mxrows, Mxcols] = size(Mx); output = interp1(1:Mxrows, interp1(1:Mxcols, Mx.', 1:.1:Mxcols).', 1:.1:Mxrows);

3 years ago | 1

Answered
How to change the colorbar limits in Matlab?
'ColorScaling','log','ColorLimits',[10^-5 10^0] When you specify colorscaling log, the colorlimits are the logs of the limits -...

3 years ago | 0

| accepted

Answered
How to bin struct fields based on value in another field?
initials = arrayfun(@(S) S.initial(1), test); finals = [test.final].'; %assuming only one value per entry bins = discretize(i...

3 years ago | 0

Answered
Dimensions do not match error during integration
your y is a numeric vector. You cannot use int() or integrate() with numeric vectors. You have y*cos() of something involving...

3 years ago | 0

Answered
how to generate code from a .mat file data?
This is not possible in the general case. It is possible to have saved objects for which there is no public method to recreate t...

3 years ago | 0

| accepted

Answered
how can I write this in a compact form? can anyone suggest a single line code for it
https://www.mathworks.com/help/matlab/ref/toeplitz.html#buxdtu9 circulant matrix Or you could add two diagonal matrices

3 years ago | 0

Answered
I want a graphical way to select/deselect points from a curve.
'Callback','ii = plotdata(x,y,hh);' When you specify a callback as a character vector, the callback is always executed in the c...

3 years ago | 0

Answered
How to translate monthly data to Quarterly?
Q_America = reshape(mean(reshape(America, 3, [], size(America,2));, 1), [], size(America,2)); This reshapes to 3 rows, an unkno...

3 years ago | 0

| accepted

Answered
How to iterate a structure name and save directory in a for loop?
saveDir = 'my/path/name for j=1:10 cnt = 50 * (j+1); clear savestruct ratefield = "rate" + cnt; savestruct....

3 years ago | 1

| accepted

Answered
LSB transform for image encryption
For legal reasons we cannot discuss encryption here. If you have two arrays and information is being transferred from a short...

3 years ago | 0

Answered
Unexpected input size: All observations must have the same channel and spatial dimension sizes.
jpeg images are almost always rgb images even if they look grayscale. True gray jpeg exist, but do not get used much because...

3 years ago | 1

Answered
how to plot index (rownumbers) in a larger dataset as range?
Your data variable has 157824 rows but your time variable only has 52560 rows . You cannot associate each row with a particular ...

3 years ago | 0

Answered
Why receive error Integrand output size does not match the input size?
If you have f, a symbolic expression nominally in x and y, but which might in practice turn out to be independent of both x and ...

3 years ago | 0

Answered
How can I do this polynomial with sympolic in matlab
if you have numeric coefficients see poly2sym()

3 years ago | 0

Answered
How to output the longest character string from two specified characters using nested for loop?
You do not need nested loops. You can loop character by character. You can be in state "outside of string" or "inside". If you a...

3 years ago | 0

Answered
Array Indices Error In Histogram Equalisation
a=imread('HG.jpg'); a1=double(a); a2=rgb2gray(uint8(a1)); the result of the above should be uint8 because the input is uint8 ...

3 years ago | 0

Answered
Method of moments using genetic optimization
You have multiple model moments, and you are returning the vector of modeled values from your function f_SMM. However, ga() can ...

3 years ago | 0

Answered
take the length of each row
This code assumes that each line ends with a comma and that the number of "values" is equal to the number of commas. It assumes ...

3 years ago | 0

| accepted

Answered
How does it work ? For loop
In pseudo-code, since MATLAB does not have any GOTO: for n=4:N means test if N < 4 if it is then assign the empty vec...

3 years ago | 0

Answered
plotting complex exponential function
Removing the variables that you do not use, and setting a finer increment for d d=(0.0075:0.001:0.03); k=(81.6*pi); y=0.71*ex...

3 years ago | 0

Answered
plotting complex exponential function
d=(0.0075:0.03); w=2*pi*f; t=(0:0.2); The default increment for the : operator is 1, so you are programming d=(0.0075:1:0.03...

3 years ago | 0

Answered
How to measure any disturbance in a signal that is exceeding a threshold?
wherebig = find(Yvf > 0.12);

3 years ago | 0

| accepted

Answered
What is the code for this cosine symbol?
acosd By convention, a trig function with a above it, represents the "arc" of the function

3 years ago | 0

| accepted

Answered
how to solve this
When you call plot, you can use plot(x1, y1, x2, y2, x3, y3, ...) where x1 and x2 and x3 and so on might happen to all be the ...

3 years ago | 0

Load more