Respondida
How to use text command with text left of xline and \rightarrow pointing to xline? Easy to place text right of xline with \leftarrow pointing from beginning of text to xline.
You could adjust the starting point to move the prepended right arrow where want it, but don't fight it; just put the two pieces...

alrededor de 4 años hace | 0

| aceptada

Respondida
How to extract two type of data from text without losing indexing?
file=readlines(websave('Test.txt','https://www.mathworks.com/matlabcentral/answers/uploaded_files/1159058/Test.txt')); file(1)=...

alrededor de 4 años hace | 0

| aceptada

Respondida
I have multiple vectors of order (1000*24)have calculated the fitness of all these.Now the want the maximum out of fitness and want the corresponding vectors and index of that
>> Clansize_11=size(AA) >> Clansize = 10 24 >> will return a 2-vector of the number rows/columns of AA. What then d...

alrededor de 4 años hace | 0

Respondida
I am trying to run a simulation 1000 times and generate a matrix 600x1000. My simulation creates a 1x600 vector
Just wrap you function (you DID us a function, didn't you, and not a script?) inside a for...end loop. Preallocate the output a...

alrededor de 4 años hace | 0

Respondida
Pull specific data from multiple text files and export it to an excel file.
That's not that big in memory footprint; big in terms of hand-processing, yes, but not a memory issues... data=readlines(websav...

alrededor de 4 años hace | 0

Respondida
2-d interpolation in matlab
As per usual, would be far easier to visualize what you're after if would provide a (smallish) sample dataset. But, if by " Kee...

alrededor de 4 años hace | 1

Respondida
I have a 3D matrix that is 64 by 700 by 10. I want to add the 700 numbers to result in a 2D 64 by 10 matrix. How do I do that?
A useful but not used commonly enough for to become aware of early on in MATLAB career, generally ... :) S=squeeze(sum(M,2)); ...

alrededor de 4 años hace | 1

| aceptada

Respondida
Can I get every combination of groups of data in a matrix
A=reshape(1:9,3,3).'; nchoosek(A(:),3) NOTA BENE: This will run out of memory real soon with larger array sizes...

alrededor de 4 años hace | 0

Respondida
How to generate matrix based on previous elements?
dt=3; % use variables for data; don't bury magic numbers in code [r,arr]=find(A); % get the arrival ti...

alrededor de 4 años hace | 0

Respondida
How can I plot outliers in their correct position with respect to the original data?
You're just plotting the selected array elements against their ordinal number; you need a corollary x value against which to plo...

alrededor de 4 años hace | 0

| aceptada

Respondida
extract the indices of matrix elements after applying a condition
A = [1.0000 2.0000; 0.1000 1.0000 ; 0.6000 0.4000 ; 5.0000 0.1000 ; 0.4000 0 ; 0.40...

alrededor de 4 años hace | 0

Respondida
Convert a sequence of datetimes to seconds from first date
T=['07-Oct-2022 12:46:50';'07-Oct-2022 12:47:21']; DT=datetime(T) Tsec=seconds(DT-DT(1)) Subtracting the first datetime value...

alrededor de 4 años hace | 7

| aceptada

Respondida
I get Arrays have incompatible sizes for this operation with an elseif statement what do i do?
A character array is just an array of bytes; the length of 'square' is six characters while the 'rectangle' is 9 -- indeed, they...

alrededor de 4 años hace | 1

Respondida
Make multiple vectors the same size
t=0.5:0.01:1.3; res=interp1(A(:,1),A(:,2),t).*interp1(B(:,1),B(:,2),t).*cos(interp1(C(:,1),C(:,2),t));

alrededor de 4 años hace | 0

| aceptada

Respondida
Why do i get the error "inconsistent row/column dimensions" for line a=X\y
This time I formatted your code for you; in future use the "CODE" button to do so (or select code and use CTRL-E). Please add t...

alrededor de 4 años hace | 0

Respondida
Data not plotting as a 'stacked' bar chart?
bar is an abomination of an implementation -- it is documented that if the input data are a vector, the 'stacked' option is inte...

alrededor de 4 años hace | 1

Respondida
How to transform data to have new minimum, maximum and average values?
OK, this has been rumbling around in back of head since posted -- one way that keeps the original dataset and adjusts them withi...

alrededor de 4 años hace | 0

| aceptada

Respondida
Tying to make an array of labels for a certain length
Why the min() operation? You'll need the same length of the quality indicator as the height of the data. I'd suggest approachi...

alrededor de 4 años hace | 0

Respondida
How to find the difference between two vectors
Well, this is a guess, but it appears that maybe you have x,y data strung together in a single vector and want to separate out t...

alrededor de 4 años hace | 0

| aceptada

Respondida
Contour plot and line plot
That will have been done with subplot more than likely; the newer tiledlayout could also be used. Is there not the code with th...

alrededor de 4 años hace | 0

| aceptada

Respondida
fft(x), why divide with L?
The short answer is "Because!" <VBG> The story behind the answer is in the reference document for the FFTW routine that MATLAB...

alrededor de 4 años hace | 0

Respondida
I'm adding legend in the graph for the 4 plot in the same graph, please help me in this.
Use something like legend('Y(11)','Y(12)','Y(13)','Y(14)',"Location","northeast"); instead. The legend entries are strings de...

alrededor de 4 años hace | 0

Respondida
How to set text position in yyaxis?
t = 1:0.1:10; yyaxis('left'); plot(t, sin(t), 'b.-', 'LineWidth', 2); ylabel('sin'); text(4,0.5,'left=0.5','BackgroundColor'...

alrededor de 4 años hace | 0

Respondida
Reading files with different extension from directory
The MATLAB builtin dir() function doesn't have the facility to handle multiple extensions in a single call; there are a couple o...

alrededor de 4 años hace | 1

| aceptada

Respondida
linspace is causing an error
In %T= (9.68.*n2.^2)./(11.6964.*n2.^2)+(1-n2.^2).*(5.8564-n2.^2).*(sin((2*pi*D)./1)).^2 you're missing a needed set of parenth...

alrededor de 4 años hace | 3

| aceptada

Respondida
Timestamp in ISO 8601 to yyyy-MM-dd HH:mm:ss
It's a pit(proverbial)a(ppendage) when vendor code produces nonstandard formats... S='0000-00-00T14:26:21:000'; % sample...

alrededor de 4 años hace | 0

| aceptada

Respondida
How to delete all files with a certain extension?
Because your count variable is being incremented in the outer loop which is running over a dir() list of all files (including su...

alrededor de 4 años hace | 0

| aceptada

Respondida
I need my graphs to display my data but they are showing up empty
No, the size of a is 1,1; the value of a is 3. Hence, you compute only one value and all your plot is/will be is a single point...

alrededor de 4 años hace | 1

Respondida
Polyfit plot just need one line
That looks like your data are just a scatter all over and you're asking polyconf to evaluate the fit and the intervals over all ...

alrededor de 4 años hace | 0

| aceptada

Respondida
Link Excel spreadsheet to Matlab
sheet=get(ex.sheets,'Item',1); should work. There's a whole litany of what will/won't actually get resolved through the COM e...

alrededor de 4 años hace | 0

Cargar más