Skip to main content

All Questions

Tagged with
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 = ...
jacky's user avatar
  • 81
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 ...
ag3007's user avatar
  • 19
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 ...
Trashman's user avatar
  • 1,596
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?
Janska's user avatar
  • 41
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 ...
Francesca Danielli's user avatar
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 ...
Enlico's user avatar
  • 28.9k
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 ...
sodiumnitrate's user avatar
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(...
Kadaj13's user avatar
  • 1,551
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 ...
ThomasIsCoding's user avatar
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 ...
phdstudent's user avatar
  • 1,144
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: ...
Miran Firdausi's user avatar
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 ...
pandaprotector's user avatar
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 ...
user148532's user avatar
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?
Ruben Krueger's user avatar
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, ...
Brethlosze's user avatar
  • 1,637

15 30 50 per page
1
2 3 4 5
13