All Questions
184 questions
0
votes
0
answers
32
views
Why do some elements of the array are missing when I copy them?
I would like to merge two arrays in one ,then choose random elements from the array but some elements are missing when I display the result.
Number_set = 0:9;
alpha_set = 'a':'z';
Number_setc = ...
0
votes
0
answers
52
views
how to ask if an array is a string?
I'm trying to write a function to change arrays to hash values, I've done it so that I can change a numerical array into their hash values but I can't seem to figure out how to change string arrays ...
2
votes
1
answer
2k
views
MATLAB Search Within a Cell Array of Cells
Setup:
I have a 21 x 3 cell array.
The first 2 columns are USUALLY strings or char arrays, but could be 1xn cells of strings or char arrays (if there are multiple alternate strings that mean the same ...
0
votes
3
answers
302
views
String to array in MATLAB
I'm trying to convert an input string "[f1 f2]", where both f1 and f2 are integers, to an array of two integers [f1 f2]. How can I do this?
0
votes
1
answer
83
views
MATLAB: combine two cell arrays of string at a specific position
I have two cells of strings: A(a,1) and B(b,1), where a>b.
I want to combine A with B, adding B at a certain position of A.
Notice that in A there are no blank rows, so I suppose that first I have ...
5
votes
2
answers
295
views
Does MATLAB provide a lossless coversion function from double to string?
tl;dr
I'm just looking for two functions, f from double to string and g from string to double, such that g(f(d)) == d for any double d (scalar and real double).
Original question
How do I convert a ...
0
votes
1
answer
61
views
Converting a string of chars to an array of numbers according to a dictionary in matlab
I have a string containing letters. I want to assing a number to each letter, and convert it to an array. Let's say I have
'ABAABCCBA'
and I have a dictionary such that A=1, B=2, C=3 and thus the ...
0
votes
2
answers
87
views
Correct way to write folder names in matlab
I have a list of folders, I want to write a matlab file to read each of them and make a new list of their subfolders.
folder_dates = ['20210426']; %there might be much more
for i=1:length(...
2
votes
2
answers
997
views
adding a string to an empty array gives `NAN`
In MATLAB, I would like to iteratively add string to array s, and I initialized s by s = []. However, when I run the code below
s = [];
s(end+1) = "a";
s(end+1) = "b";
it results ...
0
votes
2
answers
2k
views
Saving a string array to CSV
I have a 25194081x2 matrix of strings called s1. Below an outlook of how the data looks like.
I am trying to save this matrix to csv. I tried the code below but for some reason it saves the first ...
1
vote
0
answers
52
views
How to convert an array into a string separated with comma after each item?
I am working in Scilab and I am having a little difficulty in displaying "," after each items of an array when converting it into string.
Suppose I have a variable with 3 values in it, like: ...
0
votes
1
answer
34
views
Manipulating imported string array data set in Matlab
I imported a data set of values from excel into matlab as a string array and called it Pract, this is a 23x2 string. I changed the numbers to the double class type. I am now trying to find a way to ...
0
votes
1
answer
33
views
Why does my MATLAB code duplicate all symbols except spaces, which it removes?
My goal is to take an encrypted string and duplicate all symbols. Because the only inputs will be lowercase, I ignored taking uppercase characters into account.
I designed my code to anticipate the ...
0
votes
1
answer
312
views
Filter an array of strings with Matlab
In Python, I could filter a list of strings l using l = [k for k in l if 'ab' in k]). What is the equivalent of this in Matlab?
1
vote
0
answers
57
views
Define a `java.lang.String[]` inside Matlab
How to define a java.lang.String[] inside Matlab?
I have a Java code (ref.), compiled using javac and jar, for sending emails through a server.
When calling the main method from the Command Line, ...