Réponse apportée
replacing all occurrences of a string in a file using regexp
Is it required to use regexp? If not: C = readlines(FileName); m = startsWith(C, "VariableProp('" + VarName + ", 'UD', '', ");...

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
How can I run the datasample function 500 times and record each output within a cell array?
Result = zeros([size(EMG), 500]); for k = 1:500 Result(:, :, k) = datasample(EMG,size(EMG,1)); end

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
I keep getting an error that the rows and columns must be of power 2. Am confused
Most likely this is the failing command: [cratio,bpp] = wcompress('c',X,'wpeppers.wtc','spiht','maxloop',16); If so, please re...

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
Set elements to hide\visible MATLAB Guide)
The action should be done inside the callback function, which is called, when the element is clicked: function baseHeightRbtn_C...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Group number identification consecutive numbers
With FileExchange: RunLength : index = [1 0 1 1 1 0 0 0 1 1 1 0 1 1 0 0 1 1]; [b, n] = RunLength(index); m = n(b == ...

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
How to implement more steps in mathwork coding?
Maybe: fun [ …… 0ut2 …. ]= mainfun [………………….] iteration=0 while iteration < maxiterationno ... ...

plus de 3 ans il y a | 0

Réponse apportée
How do I query 200 cells containing datasets of unequal lengths using one data having complete data?
The data are not random, but the values of the former iterations. You do not reset the contents of refom to NaN in each iteratio...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Create a function to find the product of three numbers, I am trying to use random numbers but an error keeps coming up
Where did you create this function? This cannot happen in the command window. Open a file using the editor, create the function ...

plus de 3 ans il y a | 0

Réponse apportée
Error (line 43) Conversion to double from cell is not possible.
Use the debugger to examine the problem. Type this in the command window: dbstop if error and run the code again. When Matlab ...

plus de 3 ans il y a | 0

Réponse apportée
The size function does not return the right number
You do not even need a loop: m = unique([in_M, code_M],'sorted', 'rows'); [len, notImp] = size(m); m = m(m(j,2) <= 4095, :); ...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
ODE45 Multiple Degrees of Freedom Problem
The error message tells you, that Matlab fails in the function F. Unfortunately you post the other code, but not the failing fun...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Prompt the user for a number and check whether it is prime or not. Collect these prime numbers and write it to an output text file.
Your code does not collect the prime numbers. Add this in the branch, where a prime number is identified: prime_numbers = [prim...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Are the top-ranked Matlab users working for MathWorks, or do they have another job ?
You can recognize persons working for The MathWorks by the tag "staff" beside their names. Most of the top-ranked members do no...

plus de 3 ans il y a | 2

| A accepté

Réponse apportée
extract data from a specific line of a txt file
Using modern functions to parse the file: Lines = readlines('path/to/file.txt'); Lines = strtrim(Lines); % Maybe some lead...

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
Error using sum, interpn and ndgrid: Arrays have incompatible sizes for this operation
It is a bad idea to redefine "pi" as variable, because this conflicts with the constant pi. Use the debugger to examine the pro...

plus de 3 ans il y a | 0

Réponse apportée
"renamevars" doesn't return output
If you want to change this behavior, login with admin privileges and modify the file renamevars.m. You find the check of nargout...

plus de 3 ans il y a | 1

Réponse apportée
Find out the intersection of two curves despite NaN-Values
x = 0:50; m = 0.234; yaxis = 60; y = (m*x)+yaxis; V1 = [1 2 3 4 5]; V2 = [50 80 NaN 90 100]; V1(isnan(V2)) = nan; % ...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Monthly sum function with nansum not being used correctly
function Y = monthly_sum(T, X) grp = [datenum(2000, 1:252, 1), Inf]; ngrp = numel(grp) - 1; c = size(X, 2); X_hour = nan(n...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Saving a grayscale image with scaled values
folder = "directory" for i = 1:100 % Scale the image: img = fisp1(:,:,1,i); tmp = min(img(:)); img = (img -...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
create subfolders that are the same as those in another folder
oldPath = 'C:\Users\Alberto\Desktop\GLOBAL'; newPath = 'C:\Users\Alberto\Desktop\GLOBAL2'; d = dir(oldPath); dfolder...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
how to change the position of the axis data?
% Dummy contents: H = axes; plot(1:10); drawnow; % Get original ticks: XTick = H.XTick; XLabel = H.XTickLabel; nTick ...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Extracting first element of multiple arrays within a cell
result = cellfun(@(c) c(1), zz)

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Logical indexing for two conditions
Excess = zeros(size(Energy)); m = (Energy >= 20); Excess(m) = Energy(m) - 20; A simpler code, but without the wanted log...

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
ode45 doest not return some results as zeros
The initial value is zero: [T,X] = ode45(@obj.PTVP, t, [0; 0; 0; 0; 0; 0; 0; 0]); The derivatives of the first 4 elements e...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Determine if the following series converges or diverges
Of course sum(1:Inf) is divergent. Either your answer contains a space (which is invisible in a screenshot...) or the test conta...

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
How do i create a new .txt document for each run of a code?
fprintf does not create files, but writes into existing files. fopen is responsible for opening or creating files. folder = 'C:...

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
Problem evaluating OR operator
if Answer == ('1') || ('2') Matlab evaluates this condition accourding to the precedence order of the operators from left to ri...

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
I have fig file and I want export transparent file from it.
F = getframe(gcf); RGB = F.cdata; BG = get(gcf, 'color'); imwrite(gcf, 'Output.png', 'Transparency', BG);

plus de 3 ans il y a | 0

Réponse apportée
How to add and autofill a new column to very large dataset?
X(:, 2) = 17:0.0001:21; Note that: size(17:0.0001:21) This does not match "3 Million data points".

plus de 3 ans il y a | 0

Réponse apportée
Error (Index in position 1 exceeds array bounds. Index must not exceed 173.)
The error message is clear: img0 has 173 rows only, so you cannot access the indices 1:250 .

plus de 3 ans il y a | 0

Charger plus