Answered
Combinations of vectors and matrices
This is faster: function [cn, ci, cc, ca, comb] = MyComb4(n, vn, vi, vc, va) % Get combinations: cn = nchoosek(single(vn), ...

7 years ago | 0

Answered
How to upload 800 csv files that only contains numbers in a cell keeping their names
As I said: The number contain commas as decimal separators. Before such a file can be imported, in much be converted. This costs...

7 years ago | 0

| accepted

Answered
Place text below patch object
Of course text allows to set the background color: axes text(0.5, 0.5, 'Hello', ... 'Color', 'r', 'BackgroundColor', 'c')...

7 years ago | 0

| accepted

Answered
How to loadmat file and run to my code in guide
[fname, fpath] = uigetfile({'*.mat'}, ... 'Select the Vessel Signal file','multiselect','on'); d = load(fullfile(fpath...

7 years ago | 1

| accepted

Answered
speed of loop for calculating group version
This is a very bad idea: temp_g = []; for j = 1:ngroups temp_g = [temp_g ,norm(Beta(groups==j,statsIt) - Beta(groups==j,i)...

7 years ago | 0

Answered
i cant plot the graph
The function needs 3 inputs: function x = logictic1(r, x0, n) You provide 1 inut only: logistics1(1) Then the values of xo a...

7 years ago | 0

Answered
Similarity of two .wav files - unsure about the returned error.
Error using horzcat Dimensions of arrays being concatenated are not consistent. data = [x y]; This means the x and y have a d...

7 years ago | 1

| accepted

Answered
How to find common rows between two cell arrays containing string values?
What about ismember(A, B, 'rows')? I guess your inputs are: A = ["ABC", "DEF"; ... "HTG", "JUKHI"; ... "RTHG", "...

7 years ago | 0

Answered
for loop starting from 1
a = Player{4,1}(:, 1); b = Player{2,1}(:, 2); Output = zeros(length(a)-1, 1); % Pre-allocate Output(1) = sum(b(1:a...

7 years ago | 0

Answered
I need a loop which puts every (j,k) element of every matrix in different columns.
What about: d = cat(3, O{:}); d = permute(d, [3,1,2]) Now you have the wanted columns as first index.

7 years ago | 1

| accepted

Answered
How to make an image take different RGB values?
LUT = randi([0, 255], 256, 3, 'uint8'); % The look up table Img = randi([0, 255], 640, 480, 3, 'uint8'); % The image ...

7 years ago | 1

| accepted

Answered
How to create a loop
e = zeros(1, 14); % Pre-allocate for k = 2:14 e(k) = e(k-1) * (1 + ge) / (1 + y); end

7 years ago | 0

Answered
how can i determine the time it took to run an input?
You can use tic and toc, or more accurately timeit.

7 years ago | 0

Answered
Read csv file containing text and numbers for very large dataset (beyond xls limit)
Please mention, what "very large" means. Some people call a file with 1MB "large" already, because they cannot read it anymore, ...

7 years ago | 0

Answered
if string is abc return value
Maybe: [fPath, fName, fExt] = fileparts(filename); if endsWith(fName, 'a ') % With the space as in your example xxx = 1;...

7 years ago | 1

| accepted

Answered
Error with Sortrow function in Matlab R2016b
Start with omitting the brute clearing header: clc; clear all; close all; It is a waste of time to kill everything. Bette...

7 years ago | 0

Answered
Need help with steps and code to complete this.
Please read the "Getting Started" chapters of the documentation and search in the net for "Matlab onramp" to get a short instruc...

7 years ago | 0

Answered
Tryin to perform a iteration, no sucess
These lines will no do, what you expect: elseif 0 > ecij > -0.002 Matlab evaluates them from left to right. In the first step...

7 years ago | 1

Answered
Vectorizing code for runtime optimization (nested loops)
v_xb = abs(v(t,1)-v(z,1)); This looks symmetric. Is the output symmteric (I cann test this currently). Then it should be suffic...

7 years ago | 1

| accepted

Answered
I want to give an output to imread function.
The question is not meaningful. As the documentation explains, imread reads a file from the disk: doc imread Providing a strin...

7 years ago | 0

| accepted

Answered
Is 2010a version compatible with 2019b version?
No, Matlab R2010a and 2019a are not 100% compatible. Of course they are not backward compatible: R2019a uses the modern string t...

7 years ago | 0

| accepted

Answered
Question for solving ODE using one function.
The standard approach would be: distance: X(1) velocity: X(2) accleration: X(3) pressure: X(4) Then you can evaluate the de...

7 years ago | 0

Answered
How to find the smoothness of these results?
Acceleration = rand(1, 1000); % Test data Jerk = gradient(Acceleration); This replies the two sided quotient of diffe...

7 years ago | 0

Answered
Format a SD card using MATLAB
There are smarter ways to format an SD-card, see https://www.easeus.com/partition-manager-software/format-sd-card-using-windows-...

7 years ago | 2

| accepted

Answered
read inconsistent ascii file to matrix
Data = fileread(FileName); C = strsplit(Data, char(10)); % [EDITED] Remove comments: C(strncmp(C, '%', 1)) = []; match ...

7 years ago | 0

| accepted

Answered
how to find distance of each pixel of image from center of image
If your image has 640 x 480 pixels, and the center is at the pixel 320 / 240: img = rand(480, 640); y = 1:size(img, 1); x = 1...

7 years ago | 1

| accepted

Answered
Get values from callback function
Use uiwait and uiresume to wait for the pressing of the button: ... % Create check boxes: cbx1 = uicheckbox(fig,'Text','Defi...

7 years ago | 0

| accepted

Answered
How do I stop this xlswrite error message?
It is not enough to think, that the license is active. Start Excel and check the license: http://kb.mit.edu/confluence/pages/vi...

7 years ago | 0

Answered
how to match sub string with main string in a cell array??
With modern Matlab versions >= R2016b: a = {'hard';'smart';'hard drive';'smart work';'hark disk';'hard drive'}; b = {0.1;0.2;0...

7 years ago | 0

| accepted

Answered
Polyfit error warning for SDE
tau and GErr are scalars, so you have one single point for the polynomial only. Then you cannot determine a slope. I guess you ...

7 years ago | 1

| accepted

Load more