Answered
export .txt file
M = [ 4.12449 0.37223 0.89067 0.00000 0.00000 11492.2 1.000 1 17214 0.103]; [fid, msg] = fopen('answer.txt...

4 years ago | 0

| accepted

Answered
Installing a external toolbox to a matlab path.
"Path" means the list of folders stored in the function path. See: path . Create a folder onyour disk and use either pathtool t...

4 years ago | 0

Answered
I had an error when İ run the code
The error message is clear already: Functions can only be created as local or nested functions in code files. So where did ...

4 years ago | 0

Answered
rng('default') unreliable
rng('default') sets the random number generator to the initial state. This is a reliable procedure. If your code replies differ...

4 years ago | 0

Answered
How to create Plot button for Complex vector?
As far as I understand, all you need is to create a folder on your local disk and add it to Matlab's PATH: addpath('D:\MyMFiles...

4 years ago | 1

| accepted

Answered
For loop to make an array from workspace variables
"the variables are named something like: Object_01_number_01_Right" This is the core of the actual problem. Hiding data in the ...

4 years ago | 2

Answered
Semi colons aren't suppressing output
The problemis here: cmd =sprintf('t%s=cell2table(G(isec(%d)+5:isec(%d)-2,:));', SECTIONS{i}, i, i+1); % ...

4 years ago | 2

| accepted

Answered
Indexing a range of a 3d matrix incredibly slow?
If you post the relevant part of the code and some matching input data, it is very likely, that this forum can provide some impr...

4 years ago | 0

Answered
How can I extract a field from a matrix of structs, preserving the shape of the matrix?
for i1 = 1:3 for i2 = 1:4 S(i1, i2).A = 10*i1 + i2; S(i1, i2).B = 10*i1 + i2 + 1000; end end A =...

4 years ago | 0

| accepted

Answered
How to pad NaNs in a matrix having small size to make equivalent with matrix of large size?
A = [1 2 3; 4 5 6; 7 8 9]; B = [1 2; 3 4]; C = padarray(B, max(0, size(A) - size(B)), NaN, 'post')

4 years ago | 0

Answered
Saving multiple texts to an array
You have solved storing the set of areas using: area(i) . To store the set of CHAR vectors in a cell array, use: rt{i} . If you...

4 years ago | 0

Answered
Create a matrix with one vector
v = [1,2,3,4]; max(v, v.')

4 years ago | 0

Answered
Getting distance between specific numbers in array after using diff() function
x = [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 1, 0, 0, 0, -1]; pos = find(x == 1); neg = find(x == -1); len = neg...

4 years ago | 1

| accepted

Answered
Structure fieldname Rename by referring a .csv column
Import the table. Then: Fieldname = {'Test_Sig0', 'Test_Sig', 'Junk_Sig', 'Junk_Sig_1'}; DesiredName = {'Test_Sig_0', 'Test_Si...

4 years ago | 0

Answered
No supported compiler was found.
Does this help: https://www.mathworks.com/matlabcentral/answers/805646-matlab-2020a-update-6-and-xcode-v-12-5-beta-3

4 years ago | 0

Answered
How can I stop getting "Invalid or deleted object" error?
What about checking, if the objects are existing, before deleting? % delete(app.plotOptimum) ==> delete(app.plotOptimum(isgr...

4 years ago | 0

Answered
How to solve error "too many input arguments" when using imwrite('WriteMode', 'append')
"'WriteMode' and 'append' when using imwrite function to save multiple images in specific folder" - this was a bad advice. Appen...

4 years ago | 0

Answered
Mixing an audio wav file with a generated sin wave sound
The variable song is a [1443108 x 2] matrix representing a stereo signal. The sine wave is a [1 x 8401] vector. You cannot add t...

4 years ago | 0

Answered
Save variable to a matrix after a for loop
[n, m] = size(surv_matrix); [n2, m2] = size(ref_matrix); afmag3 = cell(m, m2); delay3 = cell(m, m2); doppler3 = cell...

4 years ago | 0

| accepted

Answered
change row when compiling an array
Pool = {'DTC_enabled', 'DTC_not_enabled'; ... '1_trip_failed', '1_trip_NOT_failed'; ... '2 trip failed', '2 ...

4 years ago | 0

| accepted

Answered
How to find the index of the first element which is greater than a particular value in a matrix for all the columns.
s1 = 300; s2 = 300; C = randi([0, 200], s1, s2); % Test data N = 50; % Search R = nan(s2, 1); ...

4 years ago | 0

Answered
Script optimization: for loop, if statement, large dataset
As I haved guessed already, replacing the repeated calls of Child.CmplxID by using a copy of the field, reduces the run time rea...

4 years ago | 0

| accepted

Answered
A (possibly compact) way to find (1) unique rows, when rows have switched elements, (2) rows with switched elements, and (3) indices of rows with switched elements
Although I'm still not sure about the order of outputs, this is how I would solve the problem: n = size(a, 1); ua = zer...

4 years ago | 0

Answered
Is it possible to run MATLAB cli but still have figure windows when necessary?
You can hide some components of the GUI: https://www.mathworks.com/matlabcentral/fileexchange/32005-cmdwintool CmdWinTool lean...

4 years ago | 1

Submitted


RenameField
Rename a fields of a struct - fast C-Mex

4 years ago | 2 downloads |

4.5 / 5
Thumbnail

Answered
Rename Struct Fields Old Function
Try this C-Mex verions: https://www.mathworks.com/matlabcentral/fileexchange/28516-renamefield An M-version is included also....

4 years ago | 0

Answered
How do I rename fields of a structure array?
Although this thread is old, it has a lot of views and it is worth to mention this implementation as fast C-Mex: https://www.ma...

4 years ago | 0

Answered
Cell array multiplication error
The error message means, that either B or r_prob is not a cell array. Use the debugger to find out, what type it is instead. Typ...

4 years ago | 0

| accepted

Answered
Groupcount function sort data in alphabetical order
% groupcounts sorts the input: C = {'C', 'C', 'C', 'A', 'A', 'E', 'E', 'E', 'E', 'B'}.'; [N, EVENTS] = groupcounts(C) % Let...

4 years ago | 0

| accepted

Answered
It is possible to run a script when you put a courson on a graph?
Of course this works. It depends on what exactly "put a coursor" means. Moving the mouse over the obejct? Clicking on the line? ...

4 years ago | 0

| accepted

Load more