Answered
i have a erorr with echo when i use soundsc command
MATLAB has a function named ECHO, which has no output arguments: https://www.mathworks.com/help/matlab/ref/echo.html This is w...

2 years ago | 0

Answered
Error with matrix size
The size of the matrix A is not important. The size of the RHS of the "=" is important. Lets check that size: A = rand(9,9); B...

2 years ago | 0

| accepted

Answered
how to suggest a name to save
You could download my function NEXTNAME and use it to provide the name: https://www.mathworks.com/matlabcentral/fileexchange/64...

2 years ago | 0

Answered
Converting unix time stamp to datatime
You got the ticks wrong: those values given in the DT field are simply counts of the seconds since the epoch (which is the defin...

2 years ago | 0

| accepted

Answered
how can I get a list of the countries used by the mapping toolbox as a cell array?
The regions used by WORLDMAP are (note that this is in a private directory, is subject to change, use at own risk): F = fullfil...

2 years ago | 0

Answered
How to concatenate the elements of the structure?
Where S is your structure and F is the relevant field: cat(3,S.F) https://www.mathworks.com/matlabcentral/answers/1656435-tuto...

2 years ago | 0

| accepted

Answered
concatenating the rows to have a column wise data
The MATLAB approach: T = readtable('data.csv', 'VariableNamingRule','Preserve') P = digitsPattern+":"+digitsPattern; U = stac...

2 years ago | 0

Answered
Matlab function assumed inputs
The simplest approach is to use the ARGUMENTS block: https://www.mathworks.com/help/matlab/ref/arguments.html https://www.math...

2 years ago | 1

Answered
Order of code execution seems weird
Try calling DRAWNOW after setting the editfield values.

2 years ago | 1

| accepted

Answered
how to zero pad a vector to have the same amount of data as a vector with more data?
Simpler: in(end+1:numel(verb)) = 0;

2 years ago | 2

Answered
sorting list of structures in a structure
It is unclear what the problem is, because you did not explain or show either the "wrong" order nor the "right" order. If you wa...

2 years ago | 0

| accepted

Answered
Help with Pre-allocating function values
The MATLAB approach: lf = [697,770,852,941]; hf = [1209,1336,1477]; [X,Y] = meshgrid(lf,hf); f = [X(:),Y(:)] Or T = comb...

2 years ago | 1

| accepted

Answered
I have a problem in my code. Who can help me to fix it?.. I can't find my mistake. Please help me.
Rather than forcing pseudo-indices into variable names and then attempting to use STR2FUNC.... simply use a cell array: lambda ...

2 years ago | 1

| accepted

Answered
How to avoid log10 from calculating for log values or if its calculated for complex log how do i avoid it?
"how do i avoid this function calculating the log value of negative numbers." Don't call the function with negative values. de...

2 years ago | 0

| accepted

Answered
using cell to add row
xxx = {'Lavorato assieme n. giorni',' ',1;'Giorno Positivi e negativi ',' ',2} xxx(3,:) = {'Lavorato xxx',' ',3}

2 years ago | 0

| accepted

Answered
Illegal use of reserved keyword "elseif" keep showing up?
If you align your code consistently then the problem is very clear: if inp == '0' .. end % <- delete this elseif inp =='...

2 years ago | 1

| accepted

Answered
Using repelem to vertially concatonate non-numeric variable
".. repmat function might be a better choice, since it allows the dimensions to be specified." As does REPELEM: repelem('1001_...

2 years ago | 1

Answered
Is there a functional form in Matlab to get the same result as A{:}?
The closest you can get is to convert the output into a structure and index into that (since R2019b) to generate a comma-separat...

2 years ago | 0

Answered
Error using bar: inputs must be 2-D
The command zeros(1,2,3,4,5,6,7) creates a 7D array with size 1x2x3x4x5x6x7. What you need is a 2D matrix: zeros(1,7) Tip: th...

2 years ago | 0

| accepted

Answered
Matlab - inputs must be scalar when using linspace
replace this line for i = find(~compareHeight) with for i = reshape(find(~compareHeight),1,[]) The cause is an awful, useles...

2 years ago | 0

Answered
rlocfind returns error: Execution of script poly as a function is not supported
"Execution of script poly as a function is not supported" You have created a script named POLY. Rename that script. To find th...

2 years ago | 1

| accepted

Answered
Inverse Matrix for 6x6 matrix with variables
syms x y z A = [x,y,y,0,0,0; y,x,y,0,0,0; y,y,x,0,0,0; 0,0,0,z,0,0; 0,0,0,0,z,0; 0,0,0,0,0,z]; b = inv(A)

2 years ago | 0

Answered
Trouble with date conversion
Rather than fiddling around with text or numerics, just import the 2nd column as DATETIME right from the start: fnm = 'uurgeg_3...

2 years ago | 2

Answered
How to know exactly what row (or index number?) in a table based on user input?
Fake data: dt = datetime(2023,11,1:7).'; V = rand(7,1); T = table(dt,V) Date that you want: want = datetime(2023,11,4) Obt...

2 years ago | 0

Answered
Is there a way to dynamically use either brackets or curved bracket indexing depending on a variable?
"I understand it can be done with if statements but this will take up massive amounts of space in the code so I try to avoid it....

2 years ago | 2

| accepted

Answered
Do mex functions support keyword assignment syntax?
A few simple experiments show that key=value assignment is converted by the parser into 'key',value. I don't see why it would be...

2 years ago | 0

| accepted

Answered
Replacing values in a Matrix
A = [25,40,40,40,25,25,25,25,25,25; 25,40,40,40,40,25,25,25,25,25; 25,25,40,40,40,40,25,25,25,25; 25,25,40,40,40,40,40,25,25,25;...

2 years ago | 2

Answered
how convert string in struct with 0/1
S = struct('FS',{'Si','No','Si','Rank','No'}) Z = nan(size(S)); [X,Y] = ismember({S.FS},{'No','Si'}); Z(X) = Y(X)-1

2 years ago | 0

| accepted

Answered
How to assign a mean of a variable to every year ?
The simple and efficient MATLAB approach: DateYear = [2016;2016;2010;2008;2016;2016;2009;2008;2007;2010]; SeverityCode = [3;3;...

2 years ago | 1

Answered
Convert char to table
If you already have a character vector and the goal is to print it to file, then avoid the indirection of converting to numeric ...

2 years ago | 1

Load more