Answered
How do I multiply two variables of form A(:,:, i) and B(:,:,i) where i = 20
sum(S .* Phi.^2, 3)

8 years ago | 1

| accepted

Answered
could anyone tell me how to modify the line without using randsample
unused_rows = 1:12; N_UE_rows = 2; rows = unused_rows(randperm(length(unused_rows), N_UE_rows)); This choose...

8 years ago | 0

Answered
delete value from double class by using logical class
As said already: Matrices must be rectangular. But you can use a cell array: A = [ 1 2 3 4 5 6 7; ... 8 9 1 2 3 4 ...

8 years ago | 2

| accepted

Answered
Interpolate both dataset on a same grid
I assume that this helps: B = rand(145, 73); A = rand(119, 177); y = linspace(1, 145, 199); x = linspace(1, ...

8 years ago | 1

Answered
How does the the division of image by 255 work and multiplication of one image with another? Need help understanding the bold part of the code. This code is complete and can run in MATLAB.
You create the matrix |I| with the values 0 and 255. Finally you divide the elements of |I| by 255, which is exactly the same as...

8 years ago | 1

| accepted

Answered
How to nat sort rows of a struct
Stephen's natsort <https://www.mathworks.com/matlabcentral/fileexchange/47434-natural-order-filename-sort> is useful: FileL...

8 years ago | 2

| accepted

Answered
Multiply matrices of different sizes
Your code: for yrs = 1:length(years) [N,edges,bin] = histcounts(SPEED(:,yrs),100); COUNT = N.'; % Here [...

8 years ago | 0

| accepted

Answered
I want to apply a for loop to an array (say [1 2 3]) so that the output gives every possible combination of that array (i.e. [123], [132], [213], [231], [312], [321])
result = perms(1:3) This replies a matrix, which contains the permutations as rows. If you really want the number |123| ins...

8 years ago | 1

| accepted

Answered
How can I have high quality figures?
If you use the Painters renderer and export the EPS files, Word displays the poor TIFF preview on the screen, but the vector gra...

8 years ago | 0

| accepted

Answered
MATLAB won't recognize license for old files
Do you have an active license? See <https://www.mathworks.com/matlabcentral/answers/284141-why-do-i-get-the-message-has-no-licen...

8 years ago | 0

Answered
Does anyone know the FIR and IIR filter code by using for loop ?
The question is not clear. But maybe you want a code to calculate the output of the |filter| command: <https://www.mathworks.com...

8 years ago | 0

Answered
How to overwrite contents in a existing csv file?
This cannot work. Remember, that CSV files are stored in text format. When you have e.g. the file: ... 1, 2, 3 4, 5, ...

8 years ago | 2

Answered
Is Matlab 2014b compatible with Windows Server 2012 R2?
You have found the list of compatible operating systems already: <https://mathworks.com/content/dam/mathworks/mathworks-dot-com/...

8 years ago | 0

| accepted

Answered
Cross Correlations among 56 audio files using for loop
Folder = tempdir; % Adjust to your needs FileList = dir(fullfile(Folder, '*.wav')); nFile = numel(FileList); fo...

8 years ago | 0

| accepted

Answered
Execute/load multiple .m file in single main .m file
The problem is, that in |run(a.m)| "a.m" is interpreted as the field "m" of the struct "a". Therefore you get this message, whic...

8 years ago | 3

Answered
import problem with CSV file
The "" is a "BOM", a Byte Order Mark. This is required for UTF files. When I open the attached file, I do not see such a BOM ...

8 years ago | 0

Answered
How to remove single quotes
The quotes are most likes not included in the data, but inserted only for displaying the data in the command window. Unfortunate...

8 years ago | 0

Answered
How can i open dataset in matlab which is .pkl format?
Did you take the time to search in the net before asking? * <https://xcorr.net/2013/06/12/load-pickle-files-in-matlab/> * <h...

8 years ago | 0

Answered
Coupled ODE error- too many inputs
Try it with an explicit instead of an anonymous function: function dy = fcn(t, y) g=9.8; l1=1; l2=1; m1=1; m2=1; dy =...

8 years ago | 0

| accepted

Answered
how to read .std files in matlab otherthan import data
It depends on how you want to parse the contents of the file. Maybe all you need is str = fileread(FileName);

8 years ago | 0

Answered
Closing an .exe application
Do you mean: system('TASKKILL -f -im "Windows Command Processor.exe"'); ? The "/?" is not useful here. Do you really ...

8 years ago | 0

Answered
Speed up indexing without using a loop
Maybe logical indexing is faster: N; % given nx1 matrix with some values D = inf(n,1); D(1,1) = 0; M = false(n,1);...

8 years ago | 1

| accepted

Answered
how can i get Matlab for my window 7 32 bit os?
The last version of Matlab which runs under a 32 bit system is R2015b. You can buy a current version of Matlab and download the ...

8 years ago | 0

| accepted

Answered
ODE15s time vector size
A |tspan| with 3 values has exactly the same physical meaning as with 2 values: tspan1 = [t1, t3] tspan2 = [t1, t2, t3] ...

8 years ago | 0

| accepted

Answered
Bar Graph Patterns instead of Colors
I did not try it, but maybe <https://www.mathworks.com/matlabcentral/fileexchange/24021-hatch-fill-patterns-plus-color---invert>...

8 years ago | 0

Answered
I want to save multiple images in a folder?
See https://www.mathworks.com/matlabcentral/answers/57446-faq-how-can-i-process-a-sequence-of-files for k = 1:5 FileName = s...

8 years ago | 1

| accepted

Answered
I am getting more time complexity for the below code can you
Some amrginal ideas only: Replace your |euclideanDistance()| call by: sqrt(sum((A(:) - B(:)).^2)) Move the |drawnow| ...

8 years ago | 0

Answered
cell matrix: code does not work.. can somebody help?
Try to replace zyklen{i,j,k} = num2cell(a(frames(l,j):frames(l,j+1), k)); by zyklen{i,j,k} = a(frames(l,j):frames(l...

8 years ago | 0

Answered
Turn imported column data into matrices
Data = load('q3_data.mat'); Outcome = Data.X(1, :); Variables = Data.X(2:end, :); Here I guess, that the data ...

8 years ago | 0

Load more