Answered
Why am I getting an error diagnostic when trying to export data to a folder in my path definition?
Please post the real code. I guess you did something like: filename=C:\Users\Emilio\Documents\MATLAB\Quants\Basic.xlsx; ...

8 years ago | 0

Answered
Cell contents reference from a non-cell array object table2array
Start with: Data = load('dst1993.mat') What do you get for: class(Data.Dst_val) ? If you know this, the conversi...

8 years ago | 0

Answered
Convert a struct to excel file
What about a simple loop? Result = cell(numel(scores), 2); for k = 1:numel(scores) F = scores(k).perSubjectScores.p...

8 years ago | 0

Answered
Rotating individual vectors of a vector field
If you rotate the direction, you need to rotate the start points also: x2 = cosd(90)*x - sind(90)*y; % 90 degree rotation...

8 years ago | 0

Answered
their something wrong with my script need help please
The error message is clear already and contains the required instructions: Function definitions in a script must appear at t...

8 years ago | 1

| accepted

Answered
what are the methods of Encode function in matlab?
According to the documentation, <https://www.mathworks.com/help/comm/ref/encode.html doc encode>, Matlab expects inputs like: ...

8 years ago | 0

Answered
Saving graph from GUI as .fig works, but not as .png
Please try to insert a |drawnow| command. It seems, like the new figure is not updated correctly, when it is created with Visibl...

8 years ago | 0

Answered
How do I close a Desktop window using Matlab commands?
This does not seem to be a task for Matlab. What about <https://autohotkey.com/ AutoHotKey> (link)? If you have a C compiler,...

8 years ago | 2

Answered
Hi - please what is the difference between normrnd and randn ?
1. what is the difference between normrnd and randn? doc normrnd r = normrnd(mu,sigma) generates a random number from t...

8 years ago | 8

| accepted

Answered
How to assign a value to function through another function
What exactly is the problem? You do not have to increment the loop counter |val| inside the |for| loop and the |case| blocks ...

8 years ago | 0

Answered
How do I use nested functions to share variables? (Detailed code included)
You could simply use the two variables as inputs: res = meanfun(n, m, data_matrix, speed1); and function output = ...

8 years ago | 0

| accepted

Answered
i have a two dimensional matrix inside a loop i want to save the data matrix inside the loop so that each time the loop runs the data doesn't gets overwritten with the next one what should i do?
To store 100 matrices of size 3x4: n = 100; Result = zeros(3, 4, n); for k = 1:n Result(:, :, k) = rand(3, ...

8 years ago | 0

Answered
Hi What is the method of inverse Shuffle or unshuffle of Rand Blocks I used for Image Please any one help me in this regard Thank you
According to the documentation of |randblock|: [R,I,J] = RANDBLOCK(A) also returns indices I and J, so that R equals A(I) ...

8 years ago | 0

Answered
Why can the Open function not be used in compiled applications?
Look at the file: edit(fullfile(matlabroot, 'toolbox\matlab\general\private\openpdf.m')) This is the method to open PDFs...

8 years ago | 1

Answered
How to catch/find ''Index exceeds matrix dimensions'' error line?
''Index exceeds matrix dimensions'' error line This is *not* the complete error message, but there must be a file name and l...

8 years ago | 0

Answered
How can you open figures using MATLAB compiler?
With HG2, which was introduced in R2014a, you cannot access a fig file without creating the function. While |open| is not the be...

8 years ago | 1

| accepted

Answered
How to count the number of pixels from an image for specifies colors?
Neither imread color.jpg nor load color.jpg import the pixels of the image to th variable |color|. Use this ins...

8 years ago | 1

| accepted

Answered
How to reduce time in loading data from many individual .txt files and concatenate them vertically and save the outcome in .mat format
MAT files in ascii format are a bad idea in general. The format is neither flexible nor powerful. Text files are useful only, if...

8 years ago | 1

Answered
Convert the for loop into while loop.
for i = 1:10 disp(i) end is equivalent to: i = 1; while i <= 10 disp(i) i = i + 1; end

8 years ago | 1

Answered
Find index of first empty cell in an array row
A = {'apple', rand(2, 3); 'banana', []}; find(cellfun('isempty', A),1) Note: Using the cellfun method 'isempty' is faster that...

8 years ago | 1

Answered
Is it possible to change the running index in a for cycle?
This does not work in a |for| loop, but it works with |while|: i = 1; while i <= 10 disp(i) if i == 3 i...

8 years ago | 0

Answered
How do I work with the gui?
You can create a GUI by GUIDE, AppDesigner or programmatically. For the latter you find the excellent <https://www.mathworks.com...

8 years ago | 0

Answered
How do I assign a variable to be any whole number?
You |t{i}| is a vector: t{i} = (i-1)*e : pi/w : (n*2*pi)+e*(i-1); Therefore |if t{i}==j*(2*pi)/w| would only be true, if...

8 years ago | 0

Answered
Ismember for rows or something else
Simply swap the inputs: [found, index] = ismember(a, b, 'rows') result = find(found)

8 years ago | 1

| accepted

Answered
What code is faster in MATLAB?
It depends. A compiled C++ file is *not* translated to Matlab. You can call it from Matlab like an M-function, but it is a co...

8 years ago | 0

Answered
Is it possible to write a struct type file to pcd or ply type type file?
You can use <https://www.mathworks.com/help/vision/ref/pointcloud-class.html pointCloud> to convert the data to the required dat...

8 years ago | 0

Answered
possible to increase speed of power function applied to a vector?
No. |power| is expensive. There is no magic super power operator, which can do the same work in less time. &nbsp; In some ...

8 years ago | 0

Answered
How to avoid for loop when indexing?
s = size(pairs); index = sub2ind(s, repmat((1:s(1)).', 1, s(2)), pairs) cc = pairs(index)

8 years ago | 0

| accepted

Answered
Get mouse coordinates from a specific axis
What about using the |ButtonDownFcn| of the specific axes? What exactly does "get the mouse position" mean? If you explain this,...

8 years ago | 0

Answered
How to share data between two GUI ?
function CreateGUI1 FigH = figure('Tag', 'GUI1', 'Name', 'GUI 1'); handles.Radio(1) = uicontrol('Style', 'Radiobutton', ...

8 years ago | 0

Load more