Réponse apportée
How do you solve for a Double summation with loops
If yvect and zvect are both [1 x 101] vectors, this line must fail: uvect = uvect + coef * (cos(ai * yvect) * cos(aj * zvect));...

plus de 3 ans il y a | 0

Réponse apportée
Get the "File version" of an exe file
Create a VBS script: ' File: FileProductVer.vbs Set FSO=CreateObject("Scripting.FileSystemObject") If Wscript.Arguments.Count...

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
for loops out of bounds
for loop i=0:0.5:pi; This is no valid Matlab syntax. You can run code directly in the forum's interface and you will get an er...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
How to convert Universal time to Local time?
The command tzoffset accepts one input only: [dt,dst] = tzoffset(t) Therefore the additional arguments 'EST','5' are not valid...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Why do I get this error before executing any code in matlab?
Did you search in the forum before asking? If not: https://www.mathworks.com/matlabcentral/answers/520399-why-do-i-receive-erro...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
how not to delete one figure using clf?
clf clears the contents of the current figure. If you do not want this, remove clf. Maybe all you want is to clear the current...

plus de 3 ans il y a | 0

Réponse apportée
How to insert a new line before a character in file?
What is the wanted output? A cell string? A string? Another file? % Perhaps: str = fileread('yourFile.txt'); str = '$text-text...

plus de 3 ans il y a | 1

Réponse apportée
remove brace indexing from 1x1 matrix
The quotes are not part of the contents, but shown in the command window only to show, that this is a CHAR vector. Therefore the...

plus de 3 ans il y a | 1

Réponse apportée
sprintf loop for writing equations
F{i} = sprintf(formatSpec,Dtau(i),l(i),s,alpha_1(i),alpha_1(i)); %^ ^ Curly braces for a cell string

plus de 3 ans il y a | 0

Réponse apportée
Fastest selection of a coordinate in 3d array that fulfills a condition?
If the condition is not rare in the array, a gun-shot method can be very fast: T = randi(10, 500,500,200); tic doSearch = tru...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Undefined function or variable in a POD matlab code
A strange detail: function VelocityDistributionPOD (SnapshotsAddress) SnapshotsAddress = pwd; The folder name provided as inp...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Script works on Windows OS but not on MacOS
Use the debugger to identify the problem. Type this in the command window: dbstop if error Then run the code again. If Matlab ...

plus de 3 ans il y a | 0

Réponse apportée
Plotting Sum of series: whats wrong with this code?
"k from 0 to 100" does not match "k = 1:inf;". In the equation, the sum starts at 1, not as 0. I do not see a reason to solve th...

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
Can I change iteration value in following for loop?
Maybe you mean: nf1 = 3; nf2 = 4; panel_no = 1:12; R_vx = rand(144,1); velx = repmat([panel_no.', reshape(R_vx, 12, 12)], ...

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
How to edit each matrices in a cell?
L1 = 0:5:50; L2 = 5:5:55; % By the way, these are 11 values, not 10 NTG_MeanEmpty = randi([0, 55], 50, 27); n = 11; Analysi...

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
MATLAB : Add path of parent directory containing a class, called from a child directory
What's wrong with using the absolute path? myPath = mfilename('fullpath'); myParentPath = fileparts(myPath); oldPath = addpat...

plus de 3 ans il y a | 0

Réponse apportée
I try to write audiofiles from data which is stored in a struct
folder = 'C:\Users\blabla\Single_Tones\' for i = 1:length(struc) file = fullfile(folder, sprintf('JD(%d).wav', i)); a...

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
Invalid expression, can anybody help me
What is the purpose of: x=('heart rate'); Afterwards x is the CHAR vector 'heart rate' and you compare it to numerical values....

plus de 3 ans il y a | 0

Réponse apportée
i have this error in my code how i can fixed it
The error message is exhaustive already: "Function definition not supported in this context. Create functions in code file." Yo...

plus de 3 ans il y a | 0

Réponse apportée
How to record and save myself audio and load it as myvioce.mat file with sample frequncy 5000
Fs = 5000; nBits = 16; nChannels = 1; recorder = audiorecorder(Fs, nBits, nChannels); beep recordblocking(recorder, 2); % ...

plus de 3 ans il y a | 0

Réponse apportée
how to change specific row for all file inside a folder?
Two steps: Implement the code to process 1 file. The easies way is to import the file using readlines, remove the last line and...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Export plot as 600dpi png and with variables in the file name
print(gcf, sprintf('p%d.png', iter), '-dpng', '-r600'); % [EDITED], %s -> %d

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Fast alternative to assign 0 to NaNs
Avoid calculate A_nan==0 repeatedly inside the loop. Do this once before the loop: C = cell(10, 119); for iC = 1:numel(C) ...

plus de 3 ans il y a | 1

Réponse apportée
How to test that a script is running correctly ?
The is no way to prove the correct working of scripts. The danger of interferences between scripts, e.g. by clear all commands, ...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
How to give different font size to label values and label names?
Simply specify the font directly: plot(rand(5)) set(gca,'FontName', 'TimesNewRoman', 'FontSize',16,'FontWeight', 'Bold'); xla...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Problem with defining a path to a MATLAB function
Maybe you mean: folder = '~/Desktop/Data/pat01_t1/'; Brain = load_untouch_nii(fullfile(folder, 'Brain.nii')); The first input...

plus de 3 ans il y a | 1

Réponse apportée
Conversion of C code to Matlab code
pr = 0.734; n = 1.413e-5; ts = 12 l = 10; w = 5; k =0.02428; for v = 2:2:50 re = (v * 0.277778 * l) / n; nu ...

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
Is it possible to use a script as a callback or ButtonDownFcn in uicontrol?
'ButtonDownFcn', @(h,e) run('displayText')

plus de 3 ans il y a | 0

Réponse apportée
Applying large logical masks to large arrays quickly, row wise
A C-mex version: // File: maskTCopy.c // Compile: mex -O -R2018a maskTCopy.c #include "mex.h" void mexFunction(int nlhs, m...

plus de 3 ans il y a | 0

Réponse apportée
Applying large logical masks to large arrays quickly, row wise
Here is a set of different approaches. Run the code to see timings locally on your computer. n = 500000; m = 10; data = ran...

plus de 3 ans il y a | 2

| A accepté

Charger plus