Respondida
Writing X Y values from char to a txt file
If your char class variable is named |str|: fid = fopen( 'myFile.txt', 'w' ) ; fprintf( fid, strrep( str, ';', '\n' )) ; ...

más de 12 años hace | 1

Respondida
Primer Book for Matlab
You should be able to get it as PDF from <http://www.mathworks.com/help/releases/R2013b/pdf_doc/matlab/index.html here>. For the...

más de 12 años hace | 1

Respondida
Shadowing built-in functions
I am not using packages either (yet), but I would love to have an alternate version of ADDPATH which would mount folders as pack...

más de 12 años hace | 3

| aceptada

Respondida
Importing XYZ matrix into Matlab
*EDIT:* see my second solution for a more flexible approach. *=== 1st solution.* % - Read content. fid = fopen( 'my...

más de 12 años hace | 2

| aceptada

Respondida
create one cell in excel after one iteration
What are you trying to achieve with the line? Kapitalwert(1,1)=num2cell('ZFW%d', i); Type doc num2cell you'll see...

más de 12 años hace | 1

| aceptada

Respondida
Create a new table based on cell array
Yes dataId = num2cell( 1:numel( cellarray )).' ; cData = [dataId, cellarray] ;

más de 12 años hace | 0

| aceptada

Respondida
Regular Expression to detect spaces in a string
Here is an example assuming that you want characters between |"| and |&lt;/a&gt;| and not only white spaces: >> s = regexp(...

más de 12 años hace | 3

Respondida
how to read a text file and read it line by line?
If the string defining the composite number is stored in a variable named |theNumber|: count = numel( strfind( fileread('num...

más de 12 años hace | 3

Respondida
Trouble with While and If loops
You have to think again about the condition in the WHILE statement or about the increments that you are using. To see why, assum...

más de 12 años hace | 1

| aceptada

Respondida
to which command refers ~isempty() to?
|ZoneElementProtNameUnder| is a 2D cell array. |ZoneElementProtNameUnder{1,1}| is the content of cell on column 1 and row 1 (c...

más de 12 años hace | 2

| aceptada

Respondida
Matlab. Find the indices of a cell array of strings with characters all contained in a given string (without repetition)
Here is another solution, for the fun of it .. >> spectrum = @(s) accumarray(s.'-64, ones(size(s)), [58,1]) ; >> str_spec ...

más de 12 años hace | 3

Respondida
Please explain how to understand special strings like '^(\w:)?\'
*1.* Look at the following: % Windows type of absolute path. >> fullfile( 'C:\Temp', 'C:\Temp\myFile.txt' ) ans = ...

más de 12 años hace | 1

| aceptada

Respondida
fundamental principle of multiplication
I guess that the following would work. I didn't think too much about it though and there must be a simpler or even trivial solut...

más de 12 años hace | 0

Respondida
Why subclass & superclass in OOP?
I am not sure that the room should be a super class for the desk actually, in the sense that the desk is not a specific type of ...

más de 12 años hace | 19

| aceptada

Respondida
How to write into txt file
If fopen cannot open the file, fileID is -1. Valid file IDs are generally above 2 for files that you open by yourself (1 being _...

más de 12 años hace | 1

Respondida
Could someone explain how this code works?
The line temp = 0 ; is useless, and the |temp| which appear afterwards should be |f|, the output argument. Hint: cons...

más de 12 años hace | 1

| aceptada

Respondida
Is there a reverse buffer function?
If you always have these parameters, I guess that a solution is y = x(1:10,2:end) + x(11:20,1:end-1) ; y =[y(:); x(11:20,e...

más de 12 años hace | 2

| aceptada

Respondida
Detect edge and remove it
% - Read RGB image and convert to BW. BW = im2bw( imread( 'TEST_7.jpg' )) ; % - Build vectors of logicals targeting all...

más de 12 años hace | 2

| aceptada

Respondida
Regular Expression to append a string in text file
Here is a simple and funny solution: txt = regexprep( fileread('Text_File.txt'), '([^\n\r]+)', '<s>$1</s>' ) ;

más de 12 años hace | 1

| aceptada

Respondida
What's the best way to read an ASCII/txt file containing a few lines of text and then the data I want to load into a matrix?
If you always have the same number of header lines, use TEXTSCAN and set the parameter |'HeaderLines'| to a relevant value, e.g....

más de 12 años hace | 2

| aceptada

Respondida
matlab coding question help~
Convert T into a vector with correct dimension and ordering, and then work in a vector way (I removed the ';' at the end of each...

más de 12 años hace | 2

Respondida
Find count of repeated letters (sequence)
Try to understand the following and fine-tune it to your needs: n = sum( diff([0, diff(a)==0]) == 1 ) In particular, eval...

más de 12 años hace | 0

Respondida
Extracting data from from all rows aside from those that contain NaN?
select = ~isnan( A ) ; % Vector of logicals, true at location corresponding % to non-NaN...

más de 12 años hace | 4

| aceptada

Respondida
find a specific file
You could use the following function: function fName_out = convertFilename( fName_in ) match = regexp( fName_in, '[\d_]...

más de 12 años hace | 1

| aceptada

Respondida
Delete rows in a .txt table
Here is a solution assuming that my comment above under your question was correct. % - Define run parameters. fileLocat...

más de 12 años hace | 0

| aceptada

Respondida
find the smallest route
You can use a <https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm Dijkstra> or equivalent shortest path algorithm. The are sev...

más de 12 años hace | 0

Respondida
??? Subscripted assignment dimension mismatch
First: doc interp1 and once you understand roughly what it does and its input parameters, I guess that you could modify y...

más de 12 años hace | 1

| aceptada

Respondida
Code and decode an entire struct to and from a plain string
What you are looking for is "MATLAB struct or object serialization" (on e.g. FEX or Google), but passing a serialized struct as ...

más de 12 años hace | 3

| aceptada

Respondida
How do I print a formatted matrix without using a loop?
fprintf( fid, '%f %f %f %f %f %f\n', m.' ) ; where |fig| is the file identifier returned by FOPEN (or 1 if you want to tes...

más de 12 años hace | 0

Respondida
How can I determine if one class is superior or inferior to another?
You could use property SuperclassList from the output of METACLASS recursively .. Here is an example: function tf = isSub...

más de 12 años hace | 1

Cargar más