Answered
Reading ping output using readtable
Here is an easy way to import all numeric data as numeric, and with minimal post-processing for the datestamp: T = readtable("t...

13 days ago | 1

Answered
Where to store images on computer for imread
"Is this because the image is not stored in the right place on my computer.." The only "right place" is the location where you ...

13 days ago | 0

| accepted

Submitted


Number to Words
Convert a numeric to a string with the English name of the number value (GB/IN/US).

14 days ago | 14 downloads |

Thumbnail

Submitted


Words to Number
Convert English number name/s written in a string to numeric value/s (GB/IN/US).

14 days ago | 8 downloads |

Thumbnail

Answered
How to solve " Error using vertcat Dimensions of arrays being concatenated are not consistent " problem ?
You probably think that your square brackets are creating a 4x1 vector. But they aren't, because of the random space characters...

14 days ago | 0

| accepted

Answered
How to fix broken function code?
Use array division here: s_2 = sum((x.*y)./(delta_y.^2)); % ^^ and here: s_5 = sum(x.^2./(delta_y.^2)); % ...

14 days ago | 0

| accepted

Answered
Excel to timetable, problem with datetime
"Can anyone see the reason?" The date format you are attempting to use does not match the dates given in the file text: there a...

18 days ago | 0

| accepted

Submitted


Numeric to Ordinal-String
Convert numeric values to a string array of integers with ordinal suffixes. Fully vectorized!

18 days ago | 5 downloads |

Thumbnail

Answered
How do I print coordinates in an (x, y, z) form?
r = pi; lambda = sqrt(2); phi = exp(1); fprintf('Our rectangular coordinates converted to cylindrical coordinates are (%0.2f,...

19 days ago | 0

Answered
Replacing a field in an structure that is subset within a larger structure
If EVENT is non-scalar them you will get that error. The correct approach is to use a comma-separated list. Lets try it right n...

19 days ago | 0

| accepted

Answered
How to convert /map uint16 to int16 maintaining the dynamic range so that [0] and [2^16-1] in uint16 beomes [-2^15] and [2^15-1] without going through double
inp = uint16([-Inf,pi,Inf]) Method one: use INT32 for the intermediate values: off = int32(intmin('int16')); out = int16(int3...

19 days ago | 3

| accepted

Answered
get interpolated values from timetable
INTERP1 accepts DATETIME objects: dt = datetime(1990,1,1,[9;10],0,0); A = [36;28]; B = [12;24]; T = table(dt,A,B) newT = ...

20 days ago | 0

| accepted

Answered
Better way to combine number with fraction?
Note that you will need to use SPRINTF (or COMPOSE etc) to get the right output when NANOSEC has fewer than the full nine digits...

20 days ago | 1

| accepted

Answered
Use info in the row based on it being the max value
The second output from MAX is the index, you can use that: [maxDiameter,idx] = max(diameter); row = mat(idx,:)

20 days ago | 0

Answered
Files read with "dir" have additional (nondesirable) characters
S = dir('C:\Users\XXX\Desktop\...\*.csv'); S(startsWith({S.name},'.')) = [];

20 days ago | 1

| accepted

Answered
Filtering the common rows between two matrices
A = [1,2,3; 4,5,6; 7,8,9] B = [1,2,3,90; 3,1,2,88; 4,5,6,17; 6,5,4,19; 7,8,9,12; 15,18,22,20] [X,Y] = ismember(sort(B(:,1:3),2...

20 days ago | 0

Answered
Handling Undesirable Characters in Numeric Columns When Reading a CSV File
You should NOT make changes to the original data file. fnm = 'p1.csv'; opt = detectImportOptions(fnm, 'FileType','delimitedtex...

21 days ago | 0

| accepted

Answered
how to open a file from the previous folder
Note that there is absolutely no need to call PWD. Simply use '.' to refer to the current directory: relativePathToC = './../C'...

21 days ago | 0

Answered
Turning string into a variable name for a function to use
The basic problem is that you are LOADing directly into the workspace. You have already painted yourself into a corner. However,...

22 days ago | 0

Answered
Remove duplicate lines in a document
txt = fileread('filteredSatellites.txt') rgx = '([^\n\r]+)\s+(1(\s+\S+){8})\s+(2(\s+\S+){8})'; tkn = regexp(txt,rgx,'tokens');...

22 days ago | 0

| accepted

Answered
Error: Unsupported use of the '=' operator. To compare values for equality, use '=='. To specify name-value arguments, check that name is a valid identifier with no surroundin
Get rid of the ellipses inside the square brackets of both macroLats and macroLongitudes: macroLats = [lots of numbers, -...

23 days ago | 0

Answered
Is it possible to identify variables in the workspace that contain a string and save the identified variable with another name?
Assuming that you are LOADing some MAT files, then the best approach is to avoid your situation entirely, for example by LOADing...

23 days ago | 0

| accepted

Answered
padding an array with zeros in between elements
Assuming that A is sorted, here is a simple approach: A = [7,15,21,29]; B = A(1):A(end); B(~ismember(B,A)) = 0 If A is not s...

23 days ago | 1

| accepted

Answered
Read and Sort Large Amount of Audio .wav Files
As far as I know, the only way to get get the correct order DATASTORE filenames without affecting other properties/attributes is...

23 days ago | 1

Submitted


Convert between RGB and Color Names
RGB to color name. Color name to RGB. Supports many palettes: CSS, dvips, HTML, MATLAB, RAL, SVG, X11, xcolor, xkcd,...

25 days ago | 22 downloads |

Thumbnail

Answered
MATLAB null conditional operator
"How it could be done in most simple and elegant way?" I assume that the aim is to not change the logging calls within the proj...

27 days ago | 2

Answered
Error Message "Array indices must be positive integers or logical values" from importing .txt file and get plot
plot(time, Ion,'fileNames', fileNames{fileidx-1}); % ^^ get rid of this

28 days ago | 0

Answered
I have it reading from a struct with signal names and I want to extract it and input it into a 1 column array
The solution depends on the sizes of MESSAGES and SIGNALINFO (you did not tell us either of these). Perhaps this: out = {Messa...

29 days ago | 0

Answered
How to call a MATLAB variable loaded in from a .mat file when you don't know the name of the variable beforehand
"The easiest way would be to use eval():" Use STRUCT2CELL, e.g.: C = struct2cell(load(filename)); D = C{1}; Avoid LOADing di...

29 days ago | 0

| accepted

Submitted


Round to Electronic Component Values
Round numeric array values to IEC 60063 resistor/capacitor values (E-Series of preferred numbers).

1 month ago | 10 downloads |

Thumbnail

Load more