Réponse apportée
Replacing "dir" when deploying a GUI
Try this: if isdeployed a = dir(fullfile(ctfroot, '**', '*.xlsx')); %remove '**' if you know a precise folder location...

environ 8 ans il y a | 0

| A accepté

Réponse apportée
Is it possible to use a function with 2 outputs and sometimes with 4 outputs?
See this example function as a starting point for how to make functions with variable input/output, and to do a input/output che...

environ 8 ans il y a | 1

| A accepté

Réponse apportée
Problem loading files to standalone installer when deploying a GUI as application
mcc -m myGUI.m -a ./MyExcelDir %This compiles your GUI AND add all files + subfolders specified after "-a" If using a...

environ 8 ans il y a | 0

Réponse apportée
Why i am getting this error message
The error you're getting is probably caused by an invalid/empty string in handles.edit4. And DON'T use |eval|, esepecially in a ...

environ 8 ans il y a | 2

| A accepté

Réponse apportée
How to use variables from my GUI in my function?
Seems like you're using GUIDE? You have to uncomment the |uiwait(handles.figure1)| in the |OpeningFcn|. Otherwise your GUI wi...

environ 8 ans il y a | 0

| A accepté

Réponse apportée
How can I use an if statement to compare an input in a function script?
Your |cell_num_mem_1| was never defined before the |if| statement. What is the value of this variable, or is it a function that ...

environ 8 ans il y a | 0

| A accepté

Réponse apportée
Is there a way for a GUI to be created based on input on another GUI?
You'll have to hard code a variable GUI then. <https://www.mathworks.com/help/matlab/ref/uicontrol.html> (moved from the comm...

environ 8 ans il y a | 0

| A accepté

Réponse apportée
Why doesn't legend location have "center"
Good point. Maybe because almost everyone do not use legends in the middle of a graph. The graph should highlight your data, not...

environ 8 ans il y a | 0

| A accepté

Réponse apportée
Error in logistic regression code
Your code does grow X by 1 column of 1's. See below data=xlsread('MyData'); X = data(:, [1:18]); y = data(:, 19) ...

environ 8 ans il y a | 0

| A accepté

Réponse apportée
Looking for advice on data analysis
Depends on the quality of the data. This doesn't seem like Matlab issue though, other than the fact you might be needing Statist...

environ 8 ans il y a | 0

Réponse apportée
MATLAB: How do I generate all square matrices (nxn) which meet these requirements?
N = 10; Mat = tril(ones(N), -1); Idx = find(Mat); %This gives you the index of a lower triangle. choose k = 1:sum(Mat) o...

environ 8 ans il y a | 0

| A accepté

Réponse apportée
Matlab writes junk #N/D in Excel file
Either specify the exact excel range to write to, or don't specify it at all. Xsig = rand(10, 2); xlswrite('test.xlsx', ...

environ 8 ans il y a | 2

| A accepté

Réponse apportée
I've got an error in my Matlab looks like a bug
<https://www.mathworks.com/help/matlab/matlab_prog/floating-point-numbers.html> Look at *"Avoiding Common Problems with Floatin...

environ 8 ans il y a | 1

| A accepté

Réponse apportée
How can I convert the following to a vector
G = {20 15 4.5}; G = [G{:}];

environ 8 ans il y a | 1

Réponse apportée
How to request user input to save figure? uiputfile command does not create the file after clicking 'Save'
The |uiputfile| only creates the filename and filepath based on where the user wants to save the file. You need to actually writ...

environ 8 ans il y a | 0

| A accepté

Réponse apportée
Adding functions in a for loop
Error is caused by adding a function handle to a value returned by a function handle. They're different things. Y = y(x) + ...

environ 8 ans il y a | 0

Réponse apportée
Help with conidtional loops?
Keep track of how many games and how many trials were done, and the status of the game as WonGame = 0 or WonGame = 1. %% Gu...

environ 8 ans il y a | 0

Réponse apportée
Is there a one-line way of vectorizing a matrix across rows?
A = reshape(A', 1, numel(A));

environ 8 ans il y a | 0

| A accepté

Réponse apportée
Display as red specific cells of binary image
ImBW = rand(100)>0.5; %binary image ImROI = zeros(100, 'logical'); %area you want to show as red ImROI(25:50, 25:50) =...

environ 8 ans il y a | 0

| A accepté

Réponse apportée
Remove cell array rows based on logical condition?
[Num, ~, Raw] = xlsread('yourdata.xlsx'); I = Num(:,20) == 1 | Num(:,20) == 7; %Your logical index of weekends W...

environ 8 ans il y a | 1

| A accepté

Réponse apportée
How can I reduce the memory footprint of Matlab
I'd still try increasing the swap space because IF the program rarely goes over 64GB, then you get the benefits of 16 cores *"mo...

environ 8 ans il y a | 0

Réponse apportée
Problem in Using Parallel Feature for a "For Loop"!
X has to be sliced correctly. <https://www.mathworks.com/help/distcomp/sliced-variable.html> But I didn't realize Newton Raph...

environ 8 ans il y a | 0

| A accepté

Réponse apportée
Create single structure array with variables in for loop.
%Creating some example files storing example x's for k = 1:10 x = rand(3); save(sprintf('myfilename%d.mat', k...

environ 8 ans il y a | 0

| A accepté

Réponse apportée
Find index in 3D matrix for maximum value
Here's one example to find maximum value in a 3D matrix called A A = randi(100, 3, 3, 50) [x, y, z] = ind2sub(size(A), f...

environ 8 ans il y a | 0

Réponse apportée
Function handle in a if statement
You cannot use an inequality for a function handle, as it makes no sense. Condition = @(a,T) T_g + delta_Tg; if isoTemp >...

environ 8 ans il y a | 0

| A accepté

Réponse apportée
"valid indices for 'a' are restricted in PARFOR loops" for unindexed struct?
parfor k = 1:2 a(k).b = k; end The reason |a.b = k| does NOT work is because when the parfor finishes, and there a...

environ 8 ans il y a | 2

Réponse apportée
Error using fprintf Invalid file identifier. Use fopen to generate a valid file identifier.
It seems that |gn| includes a folder path + file name. If the folder path does not exist, then |fopen| will fail. To fix, make t...

environ 8 ans il y a | 0

| A accepté

Réponse apportée
VideoReader in App Designer
I'm guessing you're familiar with callbacks in app designer? If not, here's the tutorial. >> appdesigner.internal.applicati...

environ 8 ans il y a | 0

Réponse apportée
Concatenate layered matrix into one layer
a = randi(10, 2, 133, 5); b = reshape(a, size(a, 1), size(a, 2) * size(a, 3));

environ 8 ans il y a | 0

| A accepté

Réponse apportée
Why this Error: Object returned error code: 0x800A01A8 is appear?
My guess is this is caused by the loss of write access to your file. To prevent both Excel and Matlab from trying to edit the sa...

environ 8 ans il y a | 0

| A accepté

Charger plus